Try OpenEdge Now
skip to main content
Basic Database Tools
Trigger Tasks : Creating a trigger
 

Creating a trigger

There are two types of triggers: session and schema. You create session triggers as part of an ABL procedure, and you create schema triggers using the Data Dictionary.
There are two types of schema triggers:
*Table trigger
*Field trigger
To create a table trigger:
1. ChooseSchema > Add New Table or choose Schema > Modify Table. If you are adding a new table, specify a table name. If you are modifying a table, the Data Dictionary alphabetically lists all the tables defined for your database. Select the table for which you want to create the trigger.
2. Choose Triggers. The Table Triggers dialog box appears.
3. Define the trigger attributes. For more information on the Table Triggers dialog box and the trigger attributes, see Table Triggersoption.
4. Specify whether a session trigger can override this schema trigger. For more information about session and schema triggers, see the chapter on database triggers in OpenEdge Getting Started: ABL Essentials.
5. Specify whether the database engine checks the cyclical redundancy check (CRC) code for the trigger.
6. Press PUT to enter the trigger code. The Data Dictionary displays the Trigger Code dialog box.
7. Enter the trigger code.
8. Choose OK to return to the Table Triggers dialog box.
9. Choose OK to return to the Add Table or Modify Table window.