Icon LOADINGUPDATES

Returns whether or not a trigger is being executed during the execution of a LOAD UPDATES statement.

Syntax
LOADINGUPDATES()

Returns
BOOLEAN

Usage
The LOADINGUPDATES function returns whether or not the current trigger is being executed during the execution of a LOAD UPDATES statement. This is useful for situations where you only want to log errors for insert, update, and delete operations that occur during a LOAD UPDATES statement, and have defined error triggers to handle this. Please see the CREATE TRIGGER statement for more information on creating error triggers.

Examples
-- This trigger logs any insert errors that
-- occur during a LOAD UPDATES for
-- the Customer table into a table called
-- LoadErrors

CREATE TRIGGER "LogInsertError" ERROR INSERT ON "customer"
WHEN LOADINGUPDATES()
BEGIN
   DECLARE ErrorData VARCHAR DEFAULT '';

   SET ErrorData = 'Cust #: ' + CAST(NEWROW.CustNo AS VARCHAR);
   SET ErrorData = ErrorData + 'Name: ' + NEWROW.Company;
   SET ErrorData = ErrorData + 'Error #: ' + CAST(ERRORCODE() AS VARCHAR);
   SET ErrorData = ErrorData + 'Error Msg: ' + ERRORMSG();

   EXECUTE IMMEDIATE 'INSERT INTO LoadErrors
                   (''Customer'',''INSERT'',''' + ErrorData + '''';
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