What is the trigger restriction on a mutating table?
What is the trigger restriction on a mutating table?
Rating:
Reading and writing data into tables by using database triggers are subject to a restriction. The restriction is that the session that issues a triggering statement cannot query (SELECT) or modify (INSERT, UPDATE, DELETE, etc.) a mutating table. A mutating table is a table that is currently being modified by an INSERT, UPDATE, or DELETE statement, or a table that might be updated by the effects of a declarative DELETE CASCADE referential integrity constraint. This restriction prevents a trigger from seeing an inconsistent set of data.
The restriction applies to all row triggers and to those statement triggers that are fired as a result of a DELETE CASCADE event. Any table referencing to a mutating table with a FOREIGN KEY constraint is also a mutating table. However, views being modified through an INSTEAD OF trigger are not considered mutating.
When a trigger encounters a mutating table, the following events occur:
Rating:
Other articles
- What is the DBMS_OUTPUT Oracle supplied package?
- What is the signature mode of remote dependency?
- What are the benefits of subprograms?
- What is the syntax for creating a package specification?
- What is the EXECUTE IMMEDIATE statement?