Hitachi

Hitachi Advanced Database Application Development Guide


16.5.4 SQLGetEnvAttr

Organization of this subsection

(1) Function

This ODBC function returns the current attribute value of an environment handle.

(2) Format

SQLRETURN SQLGetEnvAttr
(
  SQLHENV           EnvironmentHandle,   /* In */
  SQLINTEGER        Attribute,           /* In */
  SQLPOINTER        ValuePtr,            /* Out */
  SQLINTEGER        BufferLength,        /* In */
  SQLINTEGER      * StringLengthPtr      /* Out */
)

(3) Arguments

EnvironmentHandle

Specifies an environment handle.

Attribute

Specifies the attribute to be obtained. 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 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 that stores the total number of valid bytes in the returned attribute value. This total number of bytes does not include the number of bytes in the 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

01004

Character string data was right-truncated

N

HY000

General error

N

HY001

Memory allocation error

N

HY010

Function sequence error

Y

HY013

Memory management error

N

HY092

Invalid attribute or option identifier

Y

HYC00

Optional feature not implemented

Y

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