4D v14.1ODBC_SQLGetDiagField |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.1
ODBC_SQLGetDiagField
|
ODBC_SQLGetDiagField ( handleType ; handleID ; recNb ; diagID ; diagInfoPtr ; stringLengthPtr ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
handleType | Longint |
![]() |
Type of ID to pass to handleID | |||||
handleID | Longint |
![]() |
Handle ID for the diagnostic data structure | |||||
recNb | Longint |
![]() |
Indicates the status record from which the application seeks information | |||||
diagID | Longint |
![]() |
Indicates the field of the diagnostic whose value is to be returned | |||||
diagInfoPtr | Pointer |
![]() |
Pointer to a variable in which to return the diagnostic information. The data type depends on the value of diagID | |||||
stringLengthPtr | Pointer |
![]() |
Total length of the string returned in diagInfoPtr | |||||
Function result | Longint |
![]() |
Returns the result of the MS ODBC API function SQLGetDiagField | |||||
The ODBC_SQLGetDiagField command returns the current value of a field of a record of the diagnostic data structure (associated with a specified handleID) that contains error, warning, and status information.
handleType defines the type of ID to pass to handleID, which can be one of the following constants:
Constant | Description |
SQL_HANDLE_ENV | Environment ID |
SQL_HANDLE_DBC | Connection ID |
SQL_HANDLE_STMT | Statement ID |
SQL_HANDLE_DESC | Descriptor ID |
handleID is a handle ID for the diagnostic data structure, of the type indicated by handleType. If
handleType is SQL_HANDLE_ENV, this parameter is taken into account and the constant SQL_DEFAULT_ID can be then used.
handleID is the connectionID if handleType is equal to SQL_HANDLE_DBC. connectionID is a valid connection ID returned by ODBC_SQLAllocConnect and a connection must be established using the ODBC_SQLConnect command.
If handleType is SQL_HANDLE_STMT, handleID is the stmtID, which is a valid statement ID returned by ODBC_SQLAllocStmt.
recNb indicates the status record from which the application seeks information.
diagID indicates the field of the diagnostic whose value is to be returned. It can be one of the following values:
Constant | Description |
SQL_DIAG_CLASS_ORIGIN | A string that indicates the document that defines the class portion of the SQLSTATE value in this record |
SQL_DIAG_COLUMN_NUMBER | The column number in the result set or theparameter number in the set of parameters |
SQL_DIAG_CONNECTION_NAME | A string that indicates the name of the connection that the diagnostic record relates to. |
SQL_DIAG_CURSOR_ROW_COUNT | The count of rows in the cursor. |
SQL_DIAG_DYNAMIC_FUNCTION | This is a string that describes the SQL statement that the underlying function executed |
SQL_DIAG_DYNAMIC_FUNCTION_CODE | This is a numeric code that describes the SQL statement that was executed by the underlying function. |
SQL_DIAG_MESSAGE_TEXT | An informational message on the error or warning. |
SQL_DIAG_NATIVE | A driver/data source–specific native error code. |
SQL_DIAG_NUMBER | Number of status records that are available |
SQL_DIAG_RETURNCODE | Return code returned by the function |
SQL_DIAG_ROW_COUNT | Number of rows affected by an insert, delete, or update performed by ODBC_SQLExecute, ODBC_SQLExecDirect, ODBC_SQLBulkOperations, or ODBC_SQLSetPos |
SQL_DIAG_SERVER_NAME | A string that indicates the server name that the diagnostic record relates to. |
SQL_DIAG_SQLSTATE | A five-character SQLSTATE diagnostic code |
SQL_DIAG_SUBCLASS_ORIGIN | A string with the same format and valid values as SQL_DIAG_CLASS_ORIGIN, that identifies the defining portion of the subclass portion of the SQLSTATE code |
diagInfoPtr is a pointer to the variable in which the diagnostic information will be returned. Its type is dependent on the diagID.
stringLengthPtr is a pointer to a variable in which to return the length of the string/text returned in diagInfoPtr.
For more information, please see the SQLGetDiagField function in the MS ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms710181(VS.85).aspx.
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, SQL_INVALID_HANDLE, or SQL_NO_DATA.
Product: 4D
Theme: ODBC_Results
Number:
16955
Created: 4D ODBC Pro 2004
ODBC_SetErrorHandler
ODBC_SQLGetDiagRec
4D ODBC Pro ( 4D ODBC Pro v11.4)
4D ODBC Pro ( 4D ODBC Pro v12)
4D ODBC Pro ( 4D v13)
4D ODBC Pro ( 4D v14 R3)
4D ODBC Pro ( 4D v14.1)
4D ODBC Pro ( 4D v14 R2)
4D ODBC Pro ( 4D v14 R4)