The Action Clause of INSTEAD OF Triggers

When the trigger event for the specified view is encountered, the SQL statements of the trigger action are executed, instead of the triggering statement. Triggers defined on a view support the following syntax in the action clause.
Read syntax diagramSkip visual syntax diagram
INSTEAD OF Triggered Action

      .-,---------------------------------------.      
      V                        (1)              |      
|--(----+-| INSERT Statement |----------------+-+--)------------|
        |                      (2)            |        
        +-| DELETE Statement |----------------+        
        |                      (3)            |        
        +-| UPDATE Statement |----------------+        
        |                                 (4) |        
        +-| EXECUTE PROCEDURE Statement |-----+        
        |                                (5)  |        
        '-| EXECUTE FUNCTION Statement |------'        

Notes:
  1. See INSERT statement
  2. See DELETE statement
  3. See UPDATE statement
  4. See EXECUTE PROCEDURE statement
  5. See EXECUTE FUNCTION statement

This is not identical to the syntax of the trigger action for a trigger on a table, as described in the section Triggered Action on a Table. Because no WHEN (condition) is supported, the same trigger action is executed whenever the INSTEAD OF trigger event is encountered, and only one action list can be specified, rather than a separate list for each condition.


Copyright© 2021 HCL Technologies Limited