Identify runtime errors with SQLCODE

When an SQL statement results in a runtime error, the database server sets SQLCODE to a negative value and raises an MI_Exception event with an MI_EXCEPTION exception level.

The number in SQLCODE identifies the particular HCL Informix® runtime error. The finderr or Error Messages utility lists error messages and describes corrective actions.
Tip: The database server sets SQLCODE to 100 when a SELECT or FETCH statement encounters NOT FOUND (or END OF DATA). However, the NOT FOUND condition does not cause a database server exception. Therefore, you do not use SQLCODE to detect this condition from within a callback of a DataBlade® API module. Instead, your DataBlade API module can check for the MI_NO_MORE_RESULTS return code from the mi_get_result() function.