| Library: ODBC Include: omodbc.xin
 | Returns: Numeric An SQL return code. The following values may be returned: 
 SQL_SUCCESS (the current values were retrieved).
SQL_SUCCESS_WITH_INFO (the current values were retrieved, but a message was issued).
SQL_ERROR (an error occurred).
SQL_INVALID_HANDLE (the handle is invalid).
 | 
Declaration   define external counter function SQLGetDiagRec
     (  value counter HandleType,
        read-only SQL_handle_type Handle,
        value counter RecNumber,
        modifiable stream SQLstate,
        modifiable counter NativeError,
        modifiable stream MessageText,
        value counter BufferLength,
        modifiable counter TextLength )
Purpose
Returns the current values of multiple fields of a diagnostic record that contains error, warning, and status information. Unlike SQLGetDiagField, which returns one diagnostic field per call, SQLGetDiagRec returns several commonly used fields of a diagnostic record, including the SQLSTATE, the native error code, and the diagnostic message text. 
Input arguments:
- HandleType. A handle type identifier that describes the type of handle for which diagnostics are required. The following values are allowed: 
- SQL_HANDLE_ENV
- SQL_HANDLE_DBC
- SQL_HANDLE_STMT
- SQL_HANDLE_DESC
 
- Handle. A handle for the diagnostic data structure, of the type indicated by HandleType. If the handle type is SQL_HANDLE_ENV, the handle can be either a shared or an unshared environment handle.
- RecNumber. Indicates the status record from which the application seeks information. Status records are numbered from one (1).
- BufferLength. The length of MessageText. There is no maximum length for the diagnostic message.
Output arguments:
- SQLstate. The five-character SQL state code pertaining to the diagnostic record, RecNumber. The first two characters indicate the class; the next three indicate the subclass. This information is contained in the SQL_DIAG_SQLSTATE diagnostic field.
- NativeError. The native error code, specific to the data source. This information is located in the SQL_DIAG_NATIVE diagnostic field.
- MessageText. The diagnostic message. This information is contained in the SQL_DIAG_MESSAGE_TEXT diagnostic field.
- TextLength. The returned length of MessageText.
Generated: April 21, 1999 at 2:01:18 pm
If you have any comments about this section of the documentation, send email to [email protected]
 Copyright © OmniMark Technologies Corporation, 1988-1999.