CREATE OR REPLACE TRIGGER name { BEFORE | AFTER } { INSERT | UPDATE | DELETE } OR { INSERT | UPDATE | DELETE } ... ON table FOR EACH ROW DECLARE declarations BEGIN statements END;
The CREATE TRIGGER command defines and names a trigger that will be stored in the database.
The name to give to the trigger. This must be distinct from the name of any other trigger for the same table.
specify OR REPLACE to re-create the trigger if it already exists. Use this clause to change the definition of an existing trigger without first dropping it and re-creating it.
determines whether the function is called before or after the event.
one of INSERT, UPDATE, or DELETE; this specifies the event that will fire the trigger. Multiple events can be specified using OR.
one or both of the remaining triggering event keywords may also be specified separated by the keyword, OR, in which case these are also defined as triggering events
the name of the table the trigger is for.
this specifies whether the trigger procedure should be fired once for every row affected by the trigger event, or just once per SQL statement. If neither is specified, the trigger is defined as a statement-level trigger.
declarations are variable, cursor, or type declarations
statements are EDB-SPL program statements
Example 1: Section 14.6.1
Example 2: Section 14.6.2
Example 3: Section 14.6.3
Example 4: Section 14.6.4