Icon OPERATION

Returns the current operation (Insert, Update, or Delete) when called from within a trigger.

Syntax
OPERATION()

Returns
VARCHAR

Return values are case-sensitive and can be one of the following:

Insert
Update
Delete

Usage
The OPERATION function returns the operation that is currently being executed when a trigger is fired. This is useful for universal (ALL) triggers that are defined so that they are fired during any insert, update, or delete operation. Please see the CREATE TRIGGER statement for more information on creating triggers.

Examples
-- This trigger checks to see if the
-- State column is filled in, and if not fills
-- in the column with a default value.

CREATE TRIGGER "SetDefaultValues" BEFORE ALL ON "customer"
WHEN OPERATION() IN ('Insert','Update')
BEGIN
   IF NEWROW.State IS NULL OR TRIM(BOTH ' ' FROM NEWROW.State)='' THEN
      SET NEWROW.State='NY';
   END IF;
END

SQL 2003 Standard Deviations
This function deviates from the SQL 2003 standard in the following ways:

DeviationDetails
ExtensionThis function is an ElevateDB extension.
Image