oracle 触发器中if,求助帖!oracle触发器if中不支持子查询怎么处理

发布于:2021-11-27 15:45:30

该楼层疑似违规已被系统折叠?隐藏此楼查看此楼


create or replace trigger "DEPART_ADD_TRIGGER"


after insert on bd_deptdoc for each row


begin


if :new.def15=*Y* and :new.pk_corp in (select pk_corp from bd_corp where pk_corp=*1553* or fathercorp=*1553*) then


insert into unit_change(PK_unit_change,comcode,comcname,comshortname,addresscname,postcode,phonenumber,uppercomcode,comflag,comlevel,branchtype,


upperpath,comcodecirc,licenseno,comkind,newcomcode,validdate,invaliddate,validstatus_hr,id_hr,level_hr,updatetime)


values(change_seq.nextval,:new.remcode,:new.def9,:new.deptname,:new.addr,:new.memo,:new.phone,:new.remcode,*1*,:new.def1,:new.pk_corp,


:new.pk_deptdoc,:new.def10,:new.def3,:new.def12,:new.remcode,:new.createdate,:new.canceldate,1,:new.pk_deptdoc,:new.def1,to_char(sysdate,*yyyy-mm-dd hh24:mi:ss*));


elsif :new.def15=*N* and :new.pk_corp in (select pk_corp from bd_corp where pk_corp=*1553* or fathercorp=*1553*) then


insert into unit_change(PK_unit_change,comcode,comcname,comshortname,uppercomcode,postcode,comflag,


upperpath,newcomcode,validdate,invaliddate,validstatus_hr,id_hr,updatetime)


values(change_seq.nextval,:new.remcode,:new.deptname,:new.deptname,:new.remcode,:new.memo,*2*,


:new.pk_deptdoc,:new.remcode,:new.createdate,:new.canceldate,1,:new.pk_deptdoc,to_char(sysdate,*yyyy-mm-dd hh24:mi:ss*));


end if;


end;


报错


此上下文中不支持子查询


错误:PLS-00405: 此上下文中不支持子查询


行:4


文本:if :new.def15=*Y* and :new.pk_corp in (select pk_corp from bd_corp where pk_corp=*1553* or fathercorp=*1553*) then


错误:PL/SQL: Statement ignored


行:4


文本:if :new.def15=*Y* and :new.pk_corp in (select pk_corp from bd_corp where pk_corp=*1553* or fathercorp=*1553*) then







相关资源:oracle笔记(存储过程函数触发器游标流程控制等)

相关推荐

最新更新

猜你喜欢