create or replace trigger tri_user_material_subafter insert on user_material_subfor each row/*declarepragma autonomous_transaction;*/beginsp_saveMateriatoCache(:NEW.shtinsid, 3);end;
由于触发器前有事务及存储过程里也有事务,因此在存储过程里面需要加上单独事务一遍两边分别运行:
create or replace procedure sp_saveMateriatoCache(p_Shtinsid Integer,p_type Integer) aspragma autonomous_transaction;----就是这个x_Invorgid Integer;x_Exists Integer;x_ExistsCode Varchar2(2000);beginx_ExistsCode := null;------新增if p_type = 1 then
同时记得在存储过程里面加上commit; 不然又会多一个报错:
ORA-06519: 检测到活动的自治事务处理,已经回退
update cpcshtins s set s.wfflag = 2 where s.shtinsid = p_Shtinsid;commit;-----关键end sp_saveMateriatoCache;
本文发布于:2024-01-28 06:44:22,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/17063954685548.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |