Diagnostic Records
There are two types of diagnostic records: a header record and zero or more status records. The header record is record 0; the status records are records 1 and above.
Diagnostic records are composed of a number of separate fields. These fields are
different for the header record and the status records. In addition, ODBC
components can define their own diagnostic record fields.
Although diagnostic records can be thought of as structures, there is no
requirement for them to actually be structures; how a driver stores the diagnostic
information is driver-specific.
Fields in diagnostic records are retrieved with SQLGetDiagField. The SQLSTATE, native error number, and diagnostic message fields of status
records can be retrieved in a single call with SQLGetDiagRec.