Chapter 13

Introduction to Triggers

This chapter introduces and discusses triggers. We will look at what triggers are, how to create triggers, the difference between row-level and statement-level triggers, enabling and disabling triggers, and deleting triggers. We will also look at triggers in which one table affects another trigger, and we will discuss the issue of mutating tables.

What Is a Trigger?

A trigger is a PL/SQL procedure that executes when a table-modifying event (such as an 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 ...

Get Practical Guide to using SQL in Oracle now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.