触发器中新调用了一个存储过程.
触发器:
create or replace trigger tr_credits_wzclorder_clwzjk after update on app_wzclorder for each row declare ... begin ... p_integral_ticket_refund(:new.ordernumber,:new.userid); ... end;
存储过程:
create or replace procedure p_integral_ticket_refund(in_ordernumber varchar2, in_userid varchar2) is ... begin ... select count(*) into v_count4 from app_wzclorder where ordernumber = in_ordernumber; ... exception when others then begin ... end; end p_integral_ticket_refund;
报异常:ora-04091: 表 appuser.app_wzclorder 发生了变化, 触发器/函数不能读它
改存储过程:
create or replace procedure p_integral_ticket_refund(in_ordernumber varchar2, in_userid varchar2) is ... PRAGMA AUTONOMOUS_TRANSACTION; -- 自治事务开始 begin ... select count(*) into v_count4 from app_wzclorder where ordernumber = in_ordernumber; ... COMMIT; -- 自治事务结束 exception when others then begin ... end; end p_integral_ticket_refund;
时间: 2024-10-08 13:56:31