Defining a Trigger Event and Action

This syntax defines the event and action of a trigger on a table or on a view.
(1)
Trigger on a Table

1 
2.1  DELETE
2.1  SELECT?  OF + , column
1 ON
1 table
1 %DELETE and SELECT Clauses
1   UPDATE?  OF + , column ON table %UPDATE Clause
1  INSERT ON table
2.1   %NEW Declaration1  %Correlated Action2
2.1  %Action Clause3
DELETE and SELECT Clauses

1  %Action Clause3
1   %OLD Declaration4  %Correlated Action2
UPDATE Clause

1  %Action Clause3
1   %OLD Declaration4?  %NEW Declaration1  %Correlated Action2
Trigger on a View

1 
2.1  INSERT ON view?  REFERENCING NEW?  AS correlation
2.1  DELETE ON view?  REFERENCING OLD?  AS correlation
2.1  UPDATE ON view
2.2.1?  REFERENCING OLD? AS correlation?  NEW? AS correlation
2.2.1  REFERENCING NEW? AS correlation?  OLD? AS correlation  FOR EACH ROW  %INSTEAD OF Triggered Action5
Element Description Restrictions Syntax
column The name of a column in the triggering table Must exist Identifier
correlation Name that you declare here to qualify an old or new column value (as correlation.column) in a triggered action Must be unique in this trigger Identifier
table, view Name or synonym of the triggering table or view. The table or view can include an owner. qualifier. Must exist in the current database Identifier

The left-hand portion of the main diagram (including the table or view) defines the trigger event (sometimes called the triggering event). The rest of the diagram declares correlation names and defines the trigger action (sometimes called the triggered action).

For the syntax to specify the triggered action of triggers on tables, see Action Clause and Correlated Table Action.

For the syntax to specify the triggered action of INSTEAD OF triggers on views, see The Action Clause of INSTEAD OF Triggers.