Products Support Documentation Download
Trigger Execution

A trigger that has been created on a table will be executed based on the {before | after} trigger_event specification and a true result from the evaluation of any specified when condition. If for each statement is specified then the trigger will execute either before or after the execution of the data modification statement. If for each row is specified then the trigger will execute either before or after each row is inserted, deleted, or updated by the data modification statement. Changes made by the before trigger remain intact even when the triggering statement fails. All database changes made by the trigger_stmts are included as part of the transaction that caused the trigger to fire. Thus, a subsequent rollback will cause all the triggered database modifications to be rolled back as well.

The execution of a trigger is defined by the execution of each of the trigger_stmts: the SQL statement(s) that define the body of the trigger.

When the execution of any of the trigger_stmts of a triggered action fails then an exception condition is raised and the SQL statement that caused the execution of the trigger has no effect on the database.

If more than one trigger has been defined on a table with the same trigger_event specification, the triggers are executed in the order in which they were created.