Trigger-Type Boolean Operator
The trigger-type Boolean operators of HCL OneDB™ can test at runtime whether the currently executing triggered action was triggered by the specified type of DML event. These operators take no operands.
These operators return TRUE ('t') if the triggering event of the currently executing trigger is the DML operation corresponding to the name of the operator, and they return FALSE ('f') otherwise. These operators are valid in IF statements, in CASE expressions, and in other contexts within an SPL trigger routines where a Boolean condition is valid.
IF (INSERTING = 't') THEN LET square = NEW.X * NEW.X ELIF (DELETING = 't') THEN LET square = 0
The SELECTING, DELETING, INSERTING, and UPDATING operators are valid only in trigger UDRs that are invoked in the FOR EACH ROW triggered action of a trigger on a table, or (for the DELETING, INSERTING, and UPDATING operators) of an INSTEAD OF trigger on a view. An error is issued if you attempt to use a trigger-type Boolean operator in any other context.
- DELETING returns TRUE while MERGE is deleting a row from the target table.
- INSERTING returns TRUE while MERGE is inserting a row into the target table.
- UPDATING returns TRUE while MERGE is updating a row of the target table.