INFORMIX-4GL uses a global variable status and a global record SQLCA (SQL communication area) to detect, record, and handle all exceptions in processing.

The global variable status indicates errors from SQL statements and interactive statements. The global record SQLCA contains extensive information about the actions carried out by the database engine and the errors and warnings encountered in executing SQL statements and only SQL statements.

The SQLCA record is defined as follows:

sqlcode integer,
sqlerrm char(71),
sqlerrp char(8),
sqlerrd array[6] of integer,
sqlwarn char(8)

The values contained in the SQLCA record are as follows:

sqlca.sqlcode 0 for a successful execution of the SQL statement.
NOTFOUND(100) For a successful SQL execution that returns no rows or runs out of rows.
Negative number Error number after an unsuccessful SQL execution. The variable status is set to sqlca.sqlcode.
sqlca.sqlerrm Not used.
sqlca.sqlerrp Not used.
sqlca.sqlerrd[1] Not used.
sqlca.sqlerrd[2] The serial value of the record inserted or the ISAM error code.
sqlca.sqlerrd[3] Number of rows processed by the SQL statement.
sqlca.sqlerrd[4] Estimated CPU cost for the query.
sqlca.sqlerrd[5] Offset of the error into the SQL statement.
sqlca.sqlerrd[6] The rowid of the last row selected.
sqlca.sqlwarn[1] Blank if there are no other warnings; W if one of the other array elements is set.
sqlca.sqlwarn[2] W if a value was truncated to fit into a char variable or for a DATABASE statement, if this is a database with transactions.
sqlca.sqlwarn[3] W if an aggregate function encountered a NULL when evaluating or for a DATABASE statement, if this database is ANSI-compliant.
sqlca.sqlwarn[4] W if the number of items in the select list is not the same as the number of variables in the into clause or for a DATABASE statement, if this is an INFORMIX-OnLine database.
sqlca.sqlwarn[5] W if float-to-decimal conversion is used.
sqlca.sqlwarn[6] W if the DBANSIWARN variable is set and the last statement executed is not ANSI-compliant.
sqlca.sqlwarn[7] Not used.
sqlca.sqlwarn[8] Not used.