3.5 Error Handling

Table of Contents Previous Next


3 EDB-ODBC Driver Functionality : 3.5 Error Handling

The SQLGetDiagRec() function returns status and error information from a diagnostic record written by the ODBC functions that retrieve or set attribute values. The signature is:
SQLSMALLINT handle_type, // Input
SQLHANDLE handle, // Input
SQLSMALLINT record_number, // Input
SQLCHAR *SQLState_pointer, // Output
SQLINTEGER *native_error_pointer, // Output
SQLCHAR *error_text_pointer, // Output
SQLSMALLINT buffer_length, // Input
The handle type of the handle argument handle_type must be one of the following:
SQL_HANDLE_ENV specifies an environment handle.
SQL_HANDLE_STMT specifies a statement handle.
SQL_HANDLE_DBC specifies a connection handle.
SQL_HANDLE_DESC specifies a descriptor handle.
The status record that the application is seeking information from (must be greater than or equal to 1).
Pointer to a memory buffer that receives the SQLState error code from the record.
The length of the error_text buffer.
Pointer to the buffer that receives the size (in characters) of the error_text_pointer field. If the number of characters in the error_text_pointer parameter exceeds the number available (in buffer_length), error_text_pointer will be truncated.
SQLGetDiagRec() returns SQL_SUCCESS, SQL_ERROR, SQL_INVALID_HANDLE, SQL_SUCCESS_WITH_DATA or SQL_NO_DATA

3 EDB-ODBC Driver Functionality : 3.5 Error Handling

Table of Contents Previous Next