Diagnostic Handling Rules
All ODBC components:
The ODBC component that directly interfaces a data source:
Any ODBC component that generates an error or warning independent of the data
source:
The ODBC component that interfaces with the Driver Manager:
One ODBC component other than the Driver Manager:
Must not replace, alter, or mask errors or warnings received from another ODBC
component.
May add an additional status record when they receive a diagnostic message
from another ODBC component. The added record must add real information value to
the original message.
Must prefix its vendor identifier, its component identifier, and the data
source
Must preserve the data source
Must preserve the data source
Must supply the correct SQLSTATE for the error or warning.
Must generate the text of the diagnostic message.
Must prefix its vendor identifier and its component identifier to the
diagnostic message.
Must return a native error code, if one is available and meaningful.
Must initialize the output arguments of SQLGetDiagRec and SQLGetDiagField.
Must format and return the diagnostic information as output arguments of SQLGetDiagRec and SQLGetDiagField when that function is called.
Must set the SQLSTATE based on the native error. For file-based drivers and
DBMS-based drivers that do not use a gateway, the driver must set the SQLSTATE.
For DBMS-based drivers that use a gateway, either the driver or a gateway that
supports ODBC may set the SQLSTATE.