DB2 10.5 for Linux, UNIX, and Windows

AFTER triggers

Triggers that run after an update, insert, or delete can be used in several ways.

Example

The following example presents an AFTER trigger that increases the number of employees when a new employee is hired.

    CREATE TRIGGER NEW_HIRE
      AFTER INSERT ON EMPLOYEE
      FOR EACH ROW
      UPDATE COMPANY_STATS SET NBEMP = NBEMP + 1