Hitachi

Hitachi Advanced Database Application Development Guide


15.4 Information that is returned in the event of an error

This section explains the information that is returned if an error occurs in the HADB ODBC driver or in HADB (HADB server or HADB client).

How to obtain error information

In the event of an error, obtain error information by specifying the last handle used in SQLGetDiagField and SQLGetDiagRec or in SQLGetDiagFieldW and SQLGetDiagRecW.

The error information that can be obtained with SQLGetDiagField and SQLGetDiagRec or in SQLGetDiagFieldW and SQLGetDiagRecW depends on the location of the error.

■ HADB ODBC driver errors
  • The SQLSTATE is set for each error according to the ODBC conventions. For details about SQLSTATE values, see the ODBC Programmer's Reference in the MSDN library and the topic SQLSTATE Values in the manual HADB Messages.

  • For NativeCode, 0 is always returned.

  • For the message text, a message beginning with KFAA72 is set after the following character string:

    [Hitachi Advanced Data Binder][ODBC Driver]

■ HADB errors
  • For SQLSTATE, the SQLSTATE that corresponds to the error that occurred in HADB is set. For details about SQLSTATE, see List of SQLSTATE values in the manual HADB Messages.

  • For NativeCode, SQLCODE is set.

  • For the message text, the message returned from HADB is set following the following character string:

    [Hitachi Advanced Data Binder][ODBC Driver]

    If detailed information cannot be obtained from an HADB client, only the above character string is set.