SAP ASE displays an error message when it encounters a problem.
A message number, which uniquely identifies the error message
A severity level number between 10 and 24, which indicates the type and severity of the problem
An error state number, which allows unique identification of the line of SAP ASE code at which the error was raised
An error message, which tells you what the problem is, and may suggest how to fix it
See the Configuration Guide for your platform for a description of the error log format.
For example, if you try to access a table that does not exist, you see:
select * from publisher
Msg 208, Level 16, State 1: publisher not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).
There may be more than one error message for a single query. If there is more than one error in a batch or query, SAP ASE usually reports only the first one. Subsequent errors are reported the next time you execute the batch or query.
Error messages are stored in master..sysmessages, which is updated with each new version of SAP ASE (and has thousands of rows). Here are the first few rows (from an SAP ASE that uses us_english as the default language):
select error, severity, description from sysmessages where error >=101 and error <=106 and langid is null
error severity description ----- -------- -------------------------------------------------- 101 15 Line %d: SQL syntax error. 102 15 Incorrect syntax near '%.*s'. 103 15 The %S_MSG that starts with ’%.*s’ is too long. Maximum length is %d. 104 15 Order-by items must appear in the select-list if the statement contains set operators. 105 15 Unclosed quote before the character string '%.*s'. 106 16 Too many table names in the query. The maximum allowable is %d.
If your server supports more than one language, sysmessages stores each message in each language. The column langid is NULL for us_english and matches the syslanguages.langid for other languages installed on the server.
The sqlstate column stores the SQLSTATE value for error conditions and exceptions defined in ANSI SQL92.
Message numbers 17000 and higher are system procedure error messages and message strings.