16.5.3 SQLSetEnvAttr
- Organization of this subsection
(1) Function
This ODBC function sets environment attributes.
(2) Format
SQLRETURN SQLSetEnvAttr ( SQLHENV EnvironmentHandle, /* In */ SQLINTEGER Attribute, /* In */ SQLPOINTER ValuePtr, /* In */ SQLINTEGER StringLength /* In */ )
(3) Arguments
- EnvironmentHandle
-
Specifies an environment handle of a connection whose attributes are to be set.
- Attribute
-
Specifies the environment attributes to be set. For details about the attributes that can be specified, see 16.15 Attributes that can be specified in SQLSetEnvAttr and SQLGetEnvAttr.
- ValuePtr
-
Specifies a pointer to the values associated with Attribute or a 32-bit integer value. For details about the values that can be specified, see 16.15 Attributes that can be specified in SQLSetEnvAttr and SQLGetEnvAttr.
- StringLength
-
If ValuePtr is a pointer to character string or binary, this argument specifies the length of *ValuePtr (in bytes). If ValuePtr is an integer, this argument is ignored.
(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 |
01S02 |
Option value changed |
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 |
A connection handle has been assigned to EnvironmentHandle. |
N |
HY013 |
Memory management error |
-- |
N |
HY024 |
Invalid attribute value |
The value specified in ValuePtr is invalid for the value specified in Attribute. |
Y |
HY090 |
Invalid string or buffer length |
The value specified in StringLength is less than 0 but is not SQL_NTS. |
Y |
HY092 |
Invalid attribute or option identifier |
The specified Attribute is invalid. |
Y |
HY117 |
Connection suspended |
-- |
N |
HYC00 |
Optional feature not implemented |
The specified Attribute is a valid argument, but it is not supported by the driver. |
Y |
- Legend:
-
Y: This SQLSTATE might be returned by the HADB ODBC driver.
N: This SQLSTATE is not returned by the HADB ODBC driver.
--: None