CREATE OR REPLACE TRIGGER NEW_TRIG INSERT ON TABLE_NAME FOR EACH ROW
declare
begin
update table_name set name='xxxxxx' where id=:new.id;
end;
好象没看到after关键字?
insert on 前是不是该加个after
declare
begin
update table_name set name='xxxxxx' where id=:new.id;
end;
好象没看到after关键字?
insert on 前是不是该加个after
我用的是oracle9.2
并且就执行insert
各位高手帮忙,帮我看看这是什么问题,
如果不能用,在after insert怎么引用插入的值
as
begin
update table_name set name='xxxxxx' where id=p_id;
end;
/CREATE OR REPLACE TRIGGER NEW_TRIG INSERT ON TABLE_NAME FOR EACH ROW
begin
update_pro(:new.id);
end;
~~~~~~~~~~
declare
begin
update TABLE_NAME set name='xxxxxx' where id=:new.id;
~~~~~~~~~~
end;要是這樣的話那肯定不行啊﹖要不是這樣呢﹐再看看
new在after insert中用,我看好多书都这样写的,难道说真有问题
ORA-04091: table name is mutating, trigger/function may not see itCause: A trigger or a user-defined PL/SQL function that is referenced in the statement attempted to query or modify a table that was in the middle of being modified by the statement that fired the trigger.Action: Rewrite the trigger or function so it does not read the table.
不能对同一个表进行触发
for each row保留