Informix® and ISAM error descriptions in SQLGetDiagRec

The SQLGetDiagRec API returns diagnostic information in the output buffer, where the error description is for the HCL Informix® error message.

When the HCL Informix® server encounters an error, it returns the Informix® error code and the associated error description. There is an additional error code, the ISAM error code, which provides information that is necessary to understand the circumstances that caused the Informix® error code.

If you do not set an attribute for the SQLSetConnectAttr API, the SQLGetDiagRec API returns the Informix® error message.

If you set the SQL_DIAG_ISAM_ERROR attribute for the SQLGetDiagField API, the SQLGetDiagField API returns the ISAM error message.

If you set the SQL_INFX_ATTR_IDSISAMERRMSG attribute for the SQLSetConnectAttr API, the SQLGetDiagRec API returns both the Informix® error message and the ISAM error message.

Set the SQL_INFX_ATTR_IDSISAMERRMSG attribute in the following way:

SQLSetConnectAttr (hdbc, SQL_INFX_ATTR_IDSISAMERRMSG,
                   (SQLPOINTER)SQL_TRUE, SQL_IS_UINTEGER);