Progress
Programming
Handbook


Differences Between Schema and Session Triggers

Although their syntax is slightly different, schema and session triggers provide similar functionality. The important difference between them is that schema triggers are independent procedures; whereas session triggers are contained within a larger procedure. Because of this difference, schema triggers always execute when a specified event occurs, regardless of what application initiates the event. Session triggers are defined as part of an application and are only in effect for that application.

Since session triggers are executed from within an enclosing procedure, they have access to the frames, widgets, and variables defined in the enclosing procedure. Since schema triggers are compiled separately from the procedure that initiates their execution, they do not have access to the procedure’s frames, widgets, and variables.

Use schema triggers for processing that you always want to perform for a specific event. For example, when an order record is deleted, you may always want to delete the corresponding order-line records. Use session triggers to perform additional or independent processing when the event occurs.

Both types of triggers can return ERRORS that cause the associated event to fail. For more information on the ERROR option of the RETURN statement, see the Progress Language Reference .


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