Collection Contents Index PUT statement [ESQL] [SP] READ statement [ISQL] pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

RAISERROR statement [T-SQL]


Function 

To signal an error, and send a message to the client.

Syntax 

RAISERROR error-number [ format-string ] [, arg-list]

Authorization 

Must be connected to the database.

Side effects 

None.

See also 

CREATE TRIGGER statement

Description 

The RAISERROR statement allows user-defined errors to be signaled, and sends a message on the client.

The error-number is a five-digit integer greater than 17000.

If format-string is not supplied or is empty, the error number is used to locate an error message in the system tables. Adaptive Server Enterprise obtains messages 17000-19999 from the SYSMESSAGES table. In Adaptive Server Anywhere this table is an empty view, so errors in this range should provide a format string. Messages for error numbers of 20000 or greater are obtained from the SYS.SYSUSERMESSAGES table. The error number is stored in the global variable @@error.

The format-string is a maximum of 70 bytes long. In Adaptive Server, Anywhere the format-string length can be up to 255 bytes.

The extended values supported by the Adaptive Server Enterprise RAISERROR statement are not supported in Adaptive Server Anywhere.

The format string can contain placeholders for the arguments in the optional argument list. These placeholders are of the form %nn!, where nn is an integer between 1 and 20.

Standards and compatibility 

Example 


Collection Contents Index PUT statement [ESQL] [SP] READ statement [ISQL] pdf/chap9.pdf