Chapter Seven. Statement Level Triggers

7.1 SEQUENCE OF EVENTS

7.2 INSERT STATEMENT TRIGGER SYNTAX

7.3 STATEMENT LEVEL AGGREGATION

7.4 PROCESSING ROW CAPTURED DATA

This chapter begins with the same trigger that started Chapter 6, except this is a statement level trigger. We start with a TEMP table.

DROP TABLE TEMP;
CREATE TABLE temp (N NUMBER);

Now create an ALTER-INSERT-STATEMENT trigger.

CREATE OR REPLACE TRIGGER temp_ais
AFTER INSERT ON TEMP
BEGIN
    dbms_output.put_line('executing temp_ais');
END;

The following inserts have different results than the beginning of Chapter 6, which demonstrated a ROW trigger. We begin by inserting a single row.

 SQL> set feedback off SQL> INSERT INTO temp VALUES (1); -- insert 1 row executing temp_ais SQL> INSERT ...

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.