Icon RAISE

Re-raises an exception or creates a new user-defined exception.

Syntax
RAISE [ERROR CODE <ErrorCode> MESSAGE <ErrorMessage>]

<ErrorCode> = Any user-defined (10000-High(INTEGER)) error code

Usage
Use this statement to re-raise an existing exception or raise a new exception using the user-defined error code range of 10000 or higher.

This statement can only be used from within an EXCEPTION block or from within an error trigger when it is specified without an error code and message and is simply trying to re-raise an existing exception. See the CREATE TRIGGER topic for more information on error triggers.

Examples
-- This procedure uses an exception
-- block to handle any exceptions while
-- executing a CREATE TABLE statement

PROCEDURE CreateTestTable()
BEGIN
   DECLARE stmt STATEMENT;

   PREPARE stmt FROM 'CREATE TEMPORARY TABLE "TestTable"
                     (
                     "FirstColumn" INTEGER,
                     "SecondColumn" VARCHAR(30),
                     "ThirdColumn" CLOB,
                     PRIMARY KEY ("FirstColumn")
                     )

                     DESCRIPTION ''Test Table''';

   EXECUTE stmt;
EXCEPTION
   IF ERRORCODE()=700 THEN
      RAISE ERROR CODE 10000 MESSAGE 'Syntax error';
   ELSE
      RAISE ERROR CODE 10000 MESSAGE 'Unexpected error - ' +
           ERRORMSG();
   END IF;
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