Contents Index SETUSER statement START DATABASE statement

ASA SQL Reference
  SQL Statements

SIGNAL statement


Description 

Use this statement to signal an exception condition.

Syntax 

SIGNAL exception-name

Usage 

SIGNAL allows you to raise an exception. See Using exception handlers in procedures and triggers for a description of how exceptions are handled.

exception-name    The name of an exception declared using a DECLARE statement at the beginning of the current compound statement. The exception must correspond to a system-defined SQLSTATE or a user-defined SQLSTATE. User-defined SQLSTATE values must be in the range 99000 to 99999.

Permissions 

None.

Side effects 

None.

See also 

DECLARE statement

RESIGNAL statement

BEGIN statement

Using exception handlers in procedures and triggers

Standards and compatibility 
Example 

The following compound statement declares and signals a user-defined exception. If you execute this example from Interactive SQL, the message is displayed in the Messages pane.

BEGIN
   DECLARE myexception EXCEPTION
   FOR SQLSTATE '99001';
   SIGNAL myexception;
   EXCEPTION
      WHEN myexception THEN
         MESSAGE 'My exception signaled'
         TO CLIENT;
END

Contents Index SETUSER statement START DATABASE statement