17.2.2 Troubleshooting tips
- Organization of this subsection
(1) Tips about viewing ODBC trace information
By viewing ODBC trace information, you can see the requests the driver manager has received from sources such as applications, BI tools, and the ODBC module, and the data that was returned in response to those requests.
An application, BI tool, ODBC module, or other entity to which the driver manager returns an error typically issues the ODBC functions SQLGetDiagField and SQLGetDiagRec to acquire detailed information about the error. The SQLSTATE, NativeError, and MessageText obtained by SQLGetDiagRec is particularly useful information for troubleshooting.
- Note
-
An ODBC trace does not provide information about requests from the HADB ODBC driver, or the responses to those requests.
(2) Tips for identifying the source of an error from message text
When message text is output in relation to an error, you can use the message text to identify the source of the error. This subsection provides tips about this process.
-
Check whether the message text contains a message ID starting with KFAA. Check whether the message text includes the tag [Hitachi Advanced Data Binder] [ODBC Driver].
If either of these conditions is met, the error or warning was generated by HADB (or the HADB ODBC driver).
-
If the message starting with KFAA is in the KFAA72000 range, the error occurred in the HADB ODBC driver.
-
For all other message IDs, the error occurred in the HADB server or HADB client.
-
If the message ID or tag is only partially output, the HADB server or HADB client might have been involved in processing where the error occurred. In this case, acquire the full message from the relevant trace or log file.
-
-
Check whether the message text includes the tag [Microsoft] [ODBC Driver Manager]. If the message text contains this tag, the error or warning was generated by the driver manager.
In this case, it is likely that HADB (including the HADB ODBC driver) was not processing where the error occurred. Errors with this tag are often critical errors such as sequence errors. If these errors occur, you need to take action such as debugging the application or reviewing the settings of the BI tool or ODBC module.
-
If the message text does not contain any of the keywords in 1. or 2., it is likely that the driver manager and HADB (including the HADB ODBC driver) were not involved in processing where the error occurred. Check the settings of the BI tool or ODBC module for errors in interface or DBMS specification, and review the settings as needed.
(3) Tips about SQLSTATE values
After identifying the source of the error, identify the cause by checking the value of SQLSTATE.
-
If the driver manager is the error source
The SQLSTATE value returned by the driver manager is based on the ODBC implementation conventions. A list of SQLSTATE values can be found in the table of ODBC Error Codes in the ODBC Programmer's Reference in the MSDN Library. There you can find a simple explanation of the cause of the error, and the ODBC function that returned the SQLSTATE value. For detailed information, look up the ODBC API Reference based on the SQLSTATE value and ODBC function you identified.
-
If the HADB ODBC driver is the error source
Identify the cause of the error by checking the SQLSTATE value returned by the ODBC function.
- Note
-
Like the SQLSTATE value returned by the driver manager, the SQLSTATE value returned by the HADB ODBC driver is based on the ODBC implementation conventions. If the cause of the error can be identified in greater detail, HADB returns its own SQLSTATE value.
-
If the HADB server or HADB client is the error source
The SQLSTATE values returned by the HADB server and HADB client correspond to HADB messages. For details about the correspondence between SQLSTATE values and HADB messages, see List of SQLSTATE values in the manual HADB Messages.
Identify the cause of the error by checking the content of the corresponding message.
(4) Acquiring SQLSTATE values and message text
Use the following ODBC functions to acquire SQLSTATE values and message text:
-
SQLGetDiagField
-
SQLGetDiagFieldW
-
SQLGetDiagRec
-
SQLGetDiagRecW