Defining other business rules
DB2 provides two additional mechanisms that you can use to enforce your business rules—triggers and user-defined functions.
Defining triggers
You read about triggers in “Triggers” on page 57.
Triggers automatically execute a set of SQL statements whenever a specified event occurs. These statements validate and edit database changes, read and modify the database, and invoke functions that perform operations inside and outside the database. A trigger is a powerful mechanism. You can use triggers to define and enforce business rules that involve different states of the data.
Example: Assume that the majority of your organization's salary increases are less than or equal to 10 percent. Assume also that you need to receive ...
Get Official Introduction to DB2® for z/OS®, The, 2nd 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.