oracle 触发器自治事务
createorreplacetriggerTRG_I_DELETEbeforedeleteonwx_sheetfittingforeachrowdeclarePRAGM...
create or replace trigger TRG_I_DELETE before delete on wx_sheetfitting for each row
declare
PRAGMA AUTONOMOUS_TRANSACTION;
affirmdate1 varchar2(10);
begin
select affirmdate
into affirmdate1
from wx_sheet t
where t.sheetno = :old.sheetno;
dbms_output.put_line(affirmdate1);
if affirmdate1 is not null then
rollback;
else
commit;
end if;
end;
为什么committ 和rollback 无效? 展开
declare
PRAGMA AUTONOMOUS_TRANSACTION;
affirmdate1 varchar2(10);
begin
select affirmdate
into affirmdate1
from wx_sheet t
where t.sheetno = :old.sheetno;
dbms_output.put_line(affirmdate1);
if affirmdate1 is not null then
rollback;
else
commit;
end if;
end;
为什么committ 和rollback 无效? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询