oracle trigger

前端之家收集整理的这篇文章主要介绍了oracle trigger前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
create or replace trigger tr_x_af_insert before insert ON x FOR EACH ROW BEGIN -- by lxm 实现修改报文功能(电子口岸提交修改报文,先对已经存在的数据打上删除标记,否则会报数据重复的错误) -- EXISTS2('select * from dual where 1=1')=1 IF(exists2('select * from x x where x.is_delete=0 and x.unique_waybill_no='''|| :new.UNIQUE_WAYBILL_NO || '''')>=1) THEN update xx set x.is_delete=1 where x.is_delete=0 and x.unique_waybill_no = :new.UNIQUE_WAYBILL_NO and x.id != :new.id; END IF; -- by lml 20170712实现 中航信过来的原始舱单ciq_org_code不对的问题 if(:new.source_code ='INFOSKY') then :new.ciq_org_code:='y'; end if; end;

猜你在找的Oracle相关文章