ORA-04091-如何更改触发触发器的表? [英] ORA-04091 - How can I alter a table that a trigger fires on?
本文介绍了ORA-04091-如何更改触发触发器的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我有表 foo
,我想在触发 foo
行> t_foo 触发:
So I have table foo
and I would like to delete other foo
rows when trigger t_foo
fires:
CREATE OR REPLACE TRIGGER "t_foo" AFTER INSERT OR DELETE OR UPDATE ON foo
/*delete some other records from foo that are not :NEW.* or :OLD.* \*
如何在不获取 ORA-04091的情况下进行此操作:
表名正在更改,触发器/函数可能看不到它。
How would I go about doing this without getting a ORA-04091:
table name is mutating, trigger/function may not see it. Is this even possible?
推荐答案
为什么不能在存储过程中做到这一点,您可以在其中存储插入和删除操作,并且可以清楚地记录这种副作用行为吗?
Why not do this in a stored procedure, where you can wrap the insert and deletes in a transaction, and can clearly document this side-effect behavior?
这篇关于ORA-04091-如何更改触发触发器的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文