我想插入一条记录后,更新插入的这条记录,其中想用插入触发器做,如何实现,我是这么做的,但是执行的时候提示出错。
表AA结构:
t_id,t_name,t_age
触发器:
create or replace trigger tig_aa
after insert on aa
for each row
begin
update aa set t_age=22 where t_id=:new.t_id;
end;
ORA-04091 table string.string is mutating, trigger/function may not see it
Avoiding the mutating table error is fairly easy.We must defer processing against the mutating or constrainng table until an AFTER trigger
refer to http://asktom.oracle.com/tkyte/Mutate/index.html