SQLGetDiagRec

This function returns the diagnostic information associated with the most recently called function for a particular statement, connection, or environment handle.

Syntax :

RETCODE SQLGetDiagRec( hType,handle, recNum, sqlState, nativeErr, errMsg, errMsgMax, pcbErrMsg);

Arguments :

The arguments for SQLGetDiagRec are listed in below table.

TypeNameDescription
SQLSMALLINThTypeHandle type
SQLINTEGERhandleHandle for which the diagnostic information is wanted.
SQLSMALLINTrecNumIf there are multiple errors, this indicates which one should be retrieved. If header information is requested, this must be 0. The first error record is number 1.
SQLCHAR*sqlStateSQLSTATE as a string of 5 characters terminated by a null character. The first 2 characters indicate error class; the next 3 indicate subclass.
SQLINTEGER*nativeErrNative error code
SQLCHAR*errMsgPointer to buffer to contain the implementation defined message text.
SQLSMALLINTerrMsgMaxMaximum (that is, the allocated) length of the buffer errMsg
SQLSMALLINT*pcbErrMsgPointer to total number of bytes available to return to the errMsg buffer.
Page last modified on September 26, 2009, at 01:51 AM