6.2. Before versus After

The insert of a single row has three stages. Figure 6-1 illustrates each stage. There are two stages in which you can inject your PL/SQL code. The middle stage is the Oracle constraint enforcement. The first stage is the execution of the BEFORE-INSERT trigger. The trigger code at this stage runs BEFORE Oracle's constraint enforcement and is called a BEFORE-INSERT-ROW (BIR) trigger. You can write code that executes AFTER Oracle's constraint enforcement. This is the AFTER-INSERT-ROW (AIR) trigger.

Figure 6-1. Row Insert Trigger.

From an initial look at Figure 6-1 it seems that you can choose to perform an operation that ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition 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.