HCL OneDB and ISAM error descriptions in SQLGetDiagRec

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

When the HCL OneDB server encounters an error, it returns the HCL OneDB 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 HCL OneDB error code.

If you do not set an attribute for the SQLSetConnectAttr API, the SQLGetDiagRec API returns the HCL OneDB 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 HCL OneDB 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);