Create a Trigger Function

To define a function as being a trigger function, use the TRIGGER parameter on the FUNCTION command.

If the function is to act as a data dictionary level trigger, enter *FIELD into the first part of the parameter, and the associated data dictionary field name into the second part of the parameter.

If the function is to act as a database level trigger, enter *FILE into the first part of the parameter, and the associated database table name into the second part of the parameter. The table specified must be a physical table and not an index.

As an aid to defining new trigger functions LANSA is shipped with the following Application Templates that can be used to form the base of a trigger function:

BBFLDTRIG

Field Level Trigger Function

BBFILTRIG

Table Level Trigger Function

 

When a function is defined as a trigger function you must follow these guidelines:

When a function is defined as a trigger function you should follow these guidelines in most situations: