Introduction to SQL: Mastering the Relational Database Language, Fourth Edition/20th Anniversary Edition
by Rick F. van der Lans
Chapter 32. Triggers
Introduction
A database server is passive by nature. It performs an action only if we explicitly ask for it with, for example, an SQL statement. In this chapter, we describe the database concept that turns a passive database server into an active one. This concept is called a trigger. Just as with stored procedures, we start by giving a definition:
A trigger is a piece of code consisting of procedural and declarative statements stored in the catalog and activated by the database server if a specific operation is executed on the database, and only then when a certain condition holds.
A trigger shows many similarities to a stored procedure. First, the trigger is also a procedural database object stored in the catalog. Second, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access