16.5.5 SQLSetStmtAttr, SQLSetStmtAttrW
- Organization of this subsection
(1) Function
This ODBC function sets the attributes related to a statement.
(2) Format
-
For SQLSetStmtAttr
SQLRETURN SQLSetStmtAttr ( SQLHSTMT StatementHandle, /* In */ SQLINTEGER Attribute, /* In */ SQLPOINTER ValuePtr, /* In */ SQLINTEGER StringLength /* In */ )
-
For SQLSetStmtAttrW
SQLRETURN SQLSetStmtAttrW ( SQLHSTMT StatementHandle, /* In */ SQLINTEGER Attribute, /* In */ SQLPOINTER ValuePtr, /* In */ SQLINTEGER StringLength /* In */ )
(3) Arguments
- StatementHandle
-
Specifies a statement handle.
- Attribute
-
Specifies the attribute to be set. 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 the value to be set for the attribute specified in Attribute. For details about the attributes that can be specified, see 16.16 Attributes that can be specified in SQLSetStmtAttr, SQLSetStmtAttrW, SQLGetStmtAttr, and SQLGetStmtAttrW.
- StringLength
-
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.
(4) Return value
This ODBC function returns SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, 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 |
01S02 |
Option value changed |
Y |
|
08S01 |
Communication link failure |
N |
|
24000 |
Invalid cursor status |
N |
|
HY000 |
General error |
N |
|
HY001 |
Memory allocation error |
N |
|
HY009 |
Invalid use of null pointer |
N |
|
HY010 |
Function sequence error |
Y |
|
HY011 |
Attribute cannot be set now |
Y |
|
HY013 |
Memory management error |
N |
|
HY017 |
Invalid use of an automatically allocated descriptor handle |
Y |
|
HY024 |
Invalid attribute value |
Y |
|
HY090 |
Invalid string or buffer length |
N |
|
HY092 |
Invalid attribute or option identifier |
Y |
|
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