Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - SQL Reference » Using SQL » SQL statements » SQL statements (P-Z)


SIGNAL statement

Use this statement to signal an exception condition.

SIGNAL exception-name

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

Use exception-name to specify 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.



Side effects


See also
Standards and compatibility
  • SQL/2003   Persistent Stored Module feature.


The following compound statement declares and signals a user-defined exception. If you execute this example from Interactive SQL, the message My exception signaled appears on the Messages tab in the Results area.

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