Allows user-defined errors to be signaled, and sends a message on the client.
RAISERROR error-number [ format-string ] [, arg-list ]
The format-string can be up to 255 bytes long. This is the same as in Adaptive Server.
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.
RAISERROR 99999 'Invalid entry for this column: %1!', @val
There is no comma between the error-number and the format-string parameters. The first item following a comma is interpreted as the first item in the argument list.
The extended values supported by the SQL Server or Adaptive Server RAISERROR statement are not supported in SAP Sybase IQ.
Intermediate RAISERROR status and code information is lost after the procedure terminates. If at return time an error occurs along with the RAISERROR, then the error information is returned and the RAISERROR information is lost. The application can query intermediate RAISERROR statuses by examining @@error global variable at different execution points.