16.5.6 SQLGetStmtAttr, SQLGetStmtAttrW
- Organization of this subsection
(1) Function
This ODBC function returns the current attribute value of a statement handle.
(2) Format
-
For SQLGetStmtAttr
SQLRETURN SQLGetStmtAttr ( SQLHSTMT StatementHandle, /* In */ SQLINTEGER Attribute, /* In */ SQLPOINTER ValuePtr, /* Out */ SQLINTEGER BufferLength, /* In */ SQLINTEGER * StringLengthPtr /* Out */ )
-
For SQLGetStmtAttrW
SQLRETURN SQLGetStmtAttrW ( SQLHSTMT StatementHandle, /* In */ SQLINTEGER Attribute, /* In */ SQLPOINTER ValuePtr, /* Out */ SQLINTEGER BufferLength, /* In */ SQLINTEGER * StringLengthPtr /* Out */ )
(3) Arguments
- StatementHandle
-
Specifies a statement handle.
- Attribute
-
Specifies the attribute to be obtained. For details about the attributes that can be specified, see 16.16 Attributes that can be specified in SQLSetStmtAttr, SQLSetStmtAttrW, SQLGetStmtAttr, and SQLGetStmtAttrW.
- ValuePtr
-
Specifies a pointer to the buffer in which the attribute specified in Attribute is to be returned. NULL can also be specified in ValuePtr.
- BufferLength
-
If the type of the attribute value specified in Attribute is character string or binary, this argument specifies the length of *ValuePtr (in bytes). If it is any other data type, this argument is ignored.
- StringLengthPtr
-
Specifies a pointer to the buffer in which the total number of valid bytes in the returned attribute value is to be stored. This value does not include the length in bytes of a null terminating character. If ValuePtr is NULL, no value is returned to *StringLengthPtr.
(4) Return value
This ODBC function returns SQL_SUCCESS, SQL_ERROR, or SQL_INVALID_HANDLE.
(5) SQLSTATE
This ODBC function returns one of the following SQLSTATE values:
SQLSTATE |
Description |
Remarks |
Returned |
---|---|---|---|
01000 |
General warning |
-- |
N |
24000 |
Invalid cursor status |
N |
|
HY000 |
General error |
N |
|
HY001 |
Memory allocation error |
N |
|
HY010 |
Function sequence error |
Y |
|
HY013 |
Memory management error |
N |
|
HY090 |
Invalid string or buffer length |
N |
|
HY092 |
Invalid attribute or option identifier |
Y |
|
HY109 |
Invalid cursor position |
N |
|
HYC00 |
Optional feature not implemented |
Y |
|
HYT01 |
Connection timeout expired |
N |
|
IM001 |
Driver does not support this function |
N |
- Legend:
-
Y: This SQLSTATE might be returned by the HADB ODBC driver.
N: This SQLSTATE is not returned by the HADB ODBC driver.
--: None