UDRs as Triggered Actions

Calls to user-defined functions and procedures, including trigger routines, can be triggered actions. The triggered action list of the FOR EACH ROW clause can include calls to UDRs that call mi_trigger*( ) functions. Triggered actions are the only context in which a trigger routine of HCL OneDB™ can be invoked. For restrictions on the calling context and the syntax of trigger routines, see The REFERENCING and FOR Clauses.

You can use the EXECUTE FUNCTION statement to call any user-defined function or trigger function. Use the EXECUTE PROCEDURE statement to call any user-defined procedure or trigger procedure.

In contexts where Boolean expressions are valid, the Boolean operators SELECTING, INSERTING, DELETING, and UPDATING are valid in trigger routines and in other UDRs that are invoked in triggered action statements. These operators return TRUE ('t') if the triggering event matches the DML operation that matches the name of the operator; otherwise they return FALSE ('f'). A single trigger routine can be designed to perform different triggered actions for different types of triggering events, using these Boolean operators to execute program blocks that are appropriate to the type of trigger.

For restrictions on using SPL routines as triggered actions, see Rules for SPL Routines and Triggers and SPL Routines.