4D v16ODBC_SQLGetDiagField |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16
ODBC_SQLGetDiagField
|
ODBC_SQLGetDiagField ( handleType ; handleID ; recNb ; diagID ; diagInfoPtr ; stringLengthPtr ) -> 戻り値 | ||||||||
引数 | 型 | 説明 | ||||||
handleType | 倍長整数 |
![]() |
Type of ID to pass to handleID | |||||
handleID | 倍長整数 |
![]() |
Handle ID for the diagnostic data structure | |||||
recNb | 倍長整数 |
![]() |
Indicates the status record from which the application seeks information | |||||
diagID | 倍長整数 |
![]() |
Indicates the field of the diagnostic whose value is to be returned | |||||
diagInfoPtr | ポインター |
![]() |
Pointer to a variable in which to return the diagnostic information. The data type depends on the value of diagID | |||||
stringLengthPtr | ポインター |
![]() |
Total length of the string returned in diagInfoPtr | |||||
戻り値 | 倍長整数 |
![]() |
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.
プロダクト: 4D
テーマ: ODBC_Results
番号:
16955
初出: 4D ODBC Pro 2004
4D ODBC Pro ( 4D v16)