Triggered Action on a Table
The Triggered Action specifies a list of SQL statements to execute when a trigger is activated. The BEFORE, FOR EACH ROW, and AFTER sections of the Action Clause can each specify different list of triggered actions for the same trigger.
- 1 See Condition
- 2 See INSERT statement
- 3 See DELETE statement
- 4 See UPDATE statement
- 5 See EXECUTE PROCEDURE statement
- 6 See EXECUTE FUNCTION statement
For a trigger on a table, the trigger action consists of an optional WHEN condition and the action statements. You can specify a triggered-action list for each WHEN clause, or you can specify a single list (of one or more trigger actions) if you include no WHEN clause.
Database objects that are referenced explicitly in the trigger action or in the definition of the trigger event, such as tables, columns, and UDRs, must exist when the CREATE TRIGGER statement defines the new trigger.
CREATE TRIGGER up_itemqty UPDATE OF quantity ON items BEFORE(EXECUTE PROCEDURE upd_items_p1);If no upd_items_p1( ) routine is registered in the database when this CREATE TRIGGER statement is issued, the database server issues an error, and no up_itemqty trigger is created.