插入触发器

[复制链接]
查看11 | 回复4 | 2008-2-13 12:43:03 | 显示全部楼层 |阅读模式
我想插入一条记录后,更新插入的这条记录,其中想用插入触发器做,如何实现,我是这么做的,但是执行的时候提示出错。
表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;

那位大侠帮忙看看哪里错了,在线等。。。。。。


回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
ORA-04091 will be raise
回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
:new.t_age=22;
回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
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
回复

使用道具 举报

千问 | 2008-2-13 12:43:03 | 显示全部楼层
变异表·~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行