Contents Index Creating triggers Altering triggers

ASA SQL User's Guide
  Using Procedures, Triggers, and Batches
    Introduction to triggers

Executing triggers


Triggers execute automatically whenever an INSERT, UPDATE, or DELETE operation is performed on the table named in the trigger. A row-level trigger fires once for each row affected, while a statement-level trigger fires once for the entire statement.

When an INSERT, UPDATE, or DELETE fires a trigger, the order of operation is as follows:

  1. BEFORE triggers fire.

  2. Referential actions are performed.

  3. The operation itself is performed.

  4. AFTER triggers fire.

If any of the steps encounter an error not handled within a procedure or trigger, the preceding steps are undone, the subsequent steps are not performed, and the operation that fired the trigger fails.


Contents Index Creating triggers Altering triggers