流程控制 批处理

来源:互联网 发布:nvidia游戏优化怎么样 编辑:程序博客网 时间:2024/06/05 15:44
 

declare numss number;

begin

     select count(*) into numss from tcaudit t where t.entid='"+c.getEntId()+"' ; 

     if(numss=0) then insert into tcaudit(entId,isAudit)  values('"+c.getEntId()+"','1');     首先查看是否存在该记录,不存在则新增一条

     elsif('"+c.getisAudit()+"'=0) then update tcaudit set isAudit=1 where entId='"+c.getEntId()+"';  根据条件来更新

     elsif('"+c.getisAudit()+"'=1) then update tcaudit set isAudit=0 where entId='"+c.getEntId()+"';

     end if;

 end;

 

原创粉丝点击