Home | Previous Page | Next Page   Programming with SQL > Calling the Database Server >

SQLSTATE Value

Certain IBM Informix products, such as IBM Informix ESQL/C, support the SQLSTATE value in compliance with X/Open and ANSI SQL standards. The GET DIAGNOSTICS statement reads the SQLSTATE value to diagnose errors after you run an SQL statement. The database server returns a result code in a five-character string that is stored in a variable called SQLSTATE. The SQLSTATE error code, or value, tells you the following information about the most recently executed SQL statement:

For more information on the GET DIAGNOSTICS statement, the SQLSTATE variable, and the meaning of the SQLSTATE return codes, see the GET DIAGNOSTICS statement in the IBM Informix: Guide to SQL Syntax.

Tip:
If your IBM Informix product supports GET DIAGNOSTICS and SQLSTATE, it is recommended that you use them as the primary structure to detect, handle, and diagnose errors. Using SQLSTATE allows you to detect multiple errors, and it is ANSI compliant.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]