Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following is TRUE about mutating tables in PL/SQL triggers ?

  • A.They cannot be queried or modified during trigger execution
  • B.They can be modified freely inside row-level triggers
  • C.They cause compilation errors only
  • D.They are automatically locked permanently

Answer: A

Mutating tables cannot be queried or modified during trigger execution.

A table is 'mutating' while a DML statement is changing it. Oracle does not allow a row-level trigger on that table to read or change it, because the result would depend on the order in which rows happen to be processed. A trigger that tries raises the run-time error ORA-04091 (table is mutating, trigger/function may not see it).

So the table cannot be modified freely inside a row-level trigger. The problem shows at run time, not as a compilation error, and the restriction lasts only while the statement executes; nothing is locked permanently.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.