Icon LOG EVENT

Logs an information, warning, or error event in the logged events for the current configuration.

Syntax
LOG [INFORMATION|WARNING|ERROR] EVENT <Message>

Usage
Use this statement to log an event in the logged events for the current configuration. The message can be any text that you wish.

Any events logged using this statement will have a function name of "Logged Event" in the logged events for the current configuration.

Information Do not use this statement to log ElevateDB errors or exceptions. ElevateDB already logs such events automatically. The only exception is if a routine traps an exception, preventing it from escaping the routine in which the exception occurred. In such a case, you can use this statement to log the event.

Examples
-- This procedure uses a LOG ERROR EVENT
-- statement to log an event when an error occurs

CREATE PROCEDURE UpdateState()
BEGIN
   DECLARE CustCursor CURSOR WITH RETURN FOR Stmt;
   DECLARE CustNo INTEGER DEFAULT 0;
   DECLARE State CHAR(2) DEFAULT '';

   PREPARE Stmt FROM 'SELECT * FROM Customer';

   OPEN CustCursor;

   START TRANSACTION ON TABLES 'Customer';
   BEGIN

      FETCH FIRST FROM CustCursor ('State') INTO State;

      WHILE NOT EOF(CustCursor) DO
         IF (State='FL') THEN
            UPDATE CustCursor SET 'State'='NY';
            FETCH FROM CustCursor ('CustNo') INTO CustNo;
         END IF;
         FETCH NEXT FROM CustCursor ('State') INTO State;
      END WHILE;

      COMMIT;

   EXCEPTION
      LOG ERROR EVENT 'Unexpected error occurred during the UpdateState procedure: '+
                      CAST(ERRORCODE() AS VARCHAR)+' '+ERRORMSG();
      ROLLBACK;
   END;
END

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

DeviationDetails
ExtensionThis SQL statement is an ElevateDB extension.
Image