The SQLSTATE status value

The SQLSTATE status variable is a five-character string that the database server sets after it executes each DataBlade® API function. The value of SQLSTATE indicates the status of the function execution. The SQLSTATE status variable is compliant with ANSI and X/Open standards.

This five-character code consists of a two-character class code and a three-character subclass code. In the following figure, "IX" is the class code and "000" is the subclass code. The SQLSTATE value "IX000" indicates that an error specific to HCL Informix® has occurred.
Figure 1. The structure of the SQLSTATE code with the value "IX000"
begin figure description - This figure is described in the surrounding text. - end figure description
The SQLSTATE status variable can contain only digits and capital letters. The class code is unique but the subclass code is not. The meaning of the subclass code depends on the associated class code. The initial character of the class code indicates the source of the exception, as the following table summarizes.
Table 1. Initial SQLSTATE class-code values
Initial class-code value Source of exception code Additional information
0 - 4

A - H

X/Open and ANSI/ISO The associated subclass codes also begin in the range 0 - 4 or A - H.
5 - 9 Defined by the implementation Subclass codes are also defined by the implementation.
I - Z Informix®, a DataBlade® module, a C UDR, a client LIBMI application Any of the error messages that are specific to Informix® (those that the X/Open or ANSI/ISO reserved range does not support) have an initial class-code value of "I" (SQLSTATE value of "IX000").

If a UDR returns an error message that this routine has defined, the initial class-code value is "U" (SQLSTATE value of "U0001").

Other SQLSTATE class-code values can be defined by the implementation.

After the database server executes a DataBlade® API function, it sets SQLSTATE to indicate one of the status conditions, as the following table shows.

Table 2. Status conditions in SQLSTATE
Status condition SQLSTATE class code SQLSTATE subclass code
Success "00" "000"
Success, but no rows found "02" "000"
Success, but warnings generated "01" For ANSI and X/Open warnings:
"000" to "006"
For warnings specific to Informix®:
"I01" to "I11"
For literal warnings that DataBlade® API modules raise:
"U01"

For custom warnings that DataBlade® API modules define: other subclass values, as defined in the syserrors system catalog table

Failure, runtime error generated For ANSI and X/Open errors: > "02"

For errors that are specific to Informix®: "IX"

For literal errors that DataBlade® API modules raise: "U0"

For custom errors that DataBlade® API modules define: other class codes, as defined in the syserrors system catalog table

Error-specific value