SQL/MX 2.x Reference Manual (H06.04+)

Introduction
HP NonStop SQL/MX Reference Manual540440-003
1-35
SQL/MX Error Messages
TRIM
UPPER
USER
All other functions are SQL/MX extensions.
SQL/MX Error Messages
NonStop SQL/MX reports error messages and exception conditions within the SQL/MX
conversational interface, MXCI, and in the standard output of embedded SQL
programs. When an error condition occurs, NonStop SQL/MX returns a message
number and a brief description of the condition. For example, NonStop SQL/MX might
display this error message in MXCI:
*** ERROR[1000] A syntax error occurred.
The message number is the SQLCODE value (without the sign). In this example, the
SQLCODE value is 1000.
In MXCI, you can display the text associated with a message number (or SQLCODE
value) by using the ERROR command. See ERROR Command on page 4-26. The
ERROR command returns this information:
*** SQLSTATE (Err): 42000 SQLSTATE (Warn): 01500
*** ERROR[1000] A syntax error occurred.
The SQLCODE value has corresponding ANSI SQL:1999 SQLSTATE error and
warning values. In this example, 42000 (error) and 01500 (warning) are the
SQLSTATE values.
To view detailed cause, effect, and recovery information for ERROR[1000] and other
errors, see the SQL/MX Messages Manual.
For more information on how to access exception conditions within embedded SQL
programs, see the SQL/MX Programming Guide for C and COBOL.