Progress
Programming
Handbook


Database Triggers

A database trigger is a block of 4GL code that executes whenever a specific database event occurs. A database event is an action performed against a database. For example, when you write a record to a database, a WRITE event occurs.

Because database triggers execute whenever a database event occurs, they are useful for tasks such as referential integrity. For example, if you delete a customer record from a database, you may also want to delete all of the customer’s order records. The event (deletion of a customer record) initiates the task (deletion of all associated order records). A database trigger is ideal for this type of processing, because the same task must always be performed when the specific event occurs. Other suitable tasks are maintaining database security or writing database audit trails.

This chapter describes database events and database triggers. It also explains how to implement trigger-based replication.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095