What is an INSTEAD OF trigger?
What is an INSTEAD OF trigger?
Rating:
An INSTEAD OF trigger provides a transparent way of modifying a view that cannot be modified directly through DML (Data Manipulation Language) statements such as INSERT, UPDATE, and DELETE. An INSTEAD OF trigger is so called because, unlike other types of triggers, Oracle fires the trigger instead of executing the triggering statement.
An INSTEAD OF trigger defined on a view is fired when an INSERT, UPDATE, or DELETE statement is executed against the view. When fired, the INSTEAD OF trigger modifies the underlying tables appropriately. An INSTEAD OF trigger defined on a view is always a row trigger, i.e., the trigger is fired for each modified row of the view.
INSTEAD OF triggers can be designed only for views and not for tables. The BEFORE and AFTER options cannot be used with INSTEAD OF triggers.
Rating:
Other articles
- What is a BEFORE trigger?
- How is a trigger compiled?
- What is the syntax for creating a function?
- What is the EXECUTE IMMEDIATE statement?
- What is the difference between a procedure and function?