Chapter 64

Oracle’s Triggers

Richard Earp

Sikha Bagui

A trigger is a PL/SQL procedure that executes when a table-modifying event (insert, delete, or update) occurs. Triggers may be fired for each row affected (FOR ANY ROW [WHEN] ...), or may be fired at the statement level for an insert, update, or delete operation. Triggers may be fired before or after an event (a triggering action) takes place. There are therefore 12 categories of triggers (before/after, row/statement, update/insert/delete):

  • Before update row-level
  • Before update statement-level
  • After update row-level
  • After update statement-level
  • ...plus four for insert and four for delete

A trigger’s category is defined by the type of triggering transaction (before update, after update, ...

Get Oracle Internals now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.