先看下官方的解释:
ORA-04091: table string.string is mutating, trigger/function may not see it
Cause: A trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it.
Action: Rewrite the trigger (or function) so it does not read that table.
我遇到这个问题是这样一个场景,
UPDATE TABLEA SET ID = 100
WHERE ID = FN(TABLEA.NAME)
我在更新的同时去查看同一个表,这样就会报错 ORA-04091
解决办法:将UPDATE动作和select动作分开,不要写在一起就OK了。。。。