Runtime errors in SQLSTATE

When an SQL statement results in a runtime error, the database server stores a value in SQLSTATE whose class code is greater than "02". The actual class and subclass codes identify the particular error. ids_esqlc_0397.html#ids_esqlc_0397__sii-11-52145 lists the class and subclass codes for SQLSTATE. To retrieve the error message text, use the MESSAGE_TEXT field of the GET DIAGNOSTICS statement. The CLASS_ORIGIN and SUBCLASS_ORIGIN exception fields have a value of "ISO 9075" to indicate the source of the error.

If the SQL statement generates an error that the ANSI or X/Open standards do not support, SQLSTATE might contain either of the following values:
  • An SQLSTATE value of "IX000" indicates an error that is specific to HCL OneDB™.

    The SQLCODE variable contains the error code, and the MESSAGE_TEXT field contains the error message text and any ISAM message text. The CLASS_ORIGIN and SUBCLASS_ORIGIN exception fields have a value of "IX000" to indicate the source of the error.

  • An SQLSTATE value of "U0001" indicates a user-defined error message from a user-defined routine.

    The MESSAGE_TEXT field contains the error message text. The CLASS_ORIGIN and SUBCLASS_ORIGIN exception fields have a value of "U0001" to indicate the source of the error.