Progress
Language Reference
TRIGGER PROCEDURE Statement
Defines a schema trigger.
SYNTAX
event
The event for which the schema trigger is being defined. The Valid events are CREATE, DELETE, FIND, WRITE, and ASSIGN.
object
The object on which the event is defined. If the event is CREATE, DELETE, FIND, or WRITE, the object must be a reference to a database table. If the event is ASSIGN, the object must be a reference to a database field qualified by a table name.
options
Optional parts of the trigger header.
Headers for CREATE, DELETE, and FIND triggers take no options. Their syntaxes are as follows.
In the header for a WRITE trigger you can optionally include one or two buffer names.
In the header for an ASSIGN trigger, you can optionally specify one or two value holders. You can specify formatting for each.
EXAMPLE
The following is a WRITE trigger for the customer table. It uses the OLD BUFFER option so that it can determine whether the cust-num value has changed. If the customer’s outstanding balance exceeds its credit limit, the trigger returns the error condition (in which case the record is not updated).
NOTES
- For more information on database triggers, see the Progress Programming Handbook .
- Use the Data Dictionary to associate a trigger procedure with a table or field in the database.
- Some 3GL applications execute schema triggers. Triggers might also be executed in batch mode. Therefore, you should avoid any user-interface interactions within schema trigger procedures.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |