N/APosted on - 04/07/2012
What structure can i use to get the ISAM error from an Informatics ODBC program on unix?
Structure to capture an ISAM error
Hi Antonito. To get the ISAM error from an Informix ODBC program installed on a Unix system, you need to understand the following points:
The ISAM error can be generated when an error occurs while an SQL statement is being executed with an Informix engine. The ISAM error provides additional information about the cause of the initial error.
The ISAM error is returned by the Informix ODBC driver in the SQL_DIAG_ISAM_ERROR field of the diagnostic record. In order for you to get the ISAM error, you will need to call the SQLGetDiagField ODBC function. Take a look below for the proper syntax for the function call.
SQLGetDiagField(SQL_HANDLE_STMT, hstmt, 1, SQL_DIAG_ISAM_ERROR,(SQLPOINTER)&errornum, SQL_IS_INTEGER, NULL);
The hstmt parameter is a valid ODBC statement handle. It is required for the function call to work.
The errornum variable is an integer variable where the ISAM error will be placed. If there was no ISAM error detected, the value that will be returned will be 0.
Hope this helps.
Good luck with your ODBC adventure.