Structure to capture an ISAM error

Asked By 50 points N/A Posted on -
qa-featured

Dear friends

What structure can i use to get the ISAM error from an Informatics ODBC program on unix?

Thanks

 

SHARE
Answered By 0 points N/A #107805

Structure to capture an ISAM error

qa-featured

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.

Login/Register to Answer

Related Questions