Progress
SQL-92
Guide and Reference


Structure of Triggers

Like a stored procedure, a trigger has a specification and a body.

The body of a trigger is the same as that of a stored procedure: BEGIN and END delimiters enclosing a Java snippet. The Java code in the snippet defines the triggered action that executes when the trigger is fired.

As with stored procedures, when it processes a CREATE TRIGGER statement, Progress SQL-92 adds wrapper code to create a Java class and method that is invoked when the trigger is fired.

The trigger specification, however, is different from a stored procedure specification. It contains the following elements:

EXAMPLE

This example shows the elements of a trigger:

CREATE TRIGGER BUG_UPDATE_TRIGGER
     AFTER
     UPDATE OF STATUS REPORT, PRIORITY
     ON BUG_INFO
      REFERENCING OLDROW, NEWROW
     FOR EACH ROW
     IMPORT
    import java.sql.*. ;
 
BEGIN
   .
   .
   .
END 


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