Hitachi

Hitachi Advanced Database Application Development Guide


16.5.2 SQLGetConnectAttr, SQLGetConnectAttrW

Organization of this subsection

(1) Function

This ODBC function returns the current attribute value of a connection handle.

(2) Format

(3) Arguments

ConnectionHandle

Specifies a connection handle.

Attribute

Specifies the attribute to be obtained. For details about the attributes that can be specified, see 16.14 Attributes that can be specified in SQLSetConnectAttr, SQLSetConnectAttrW, SQLGetConnectAttr, and SQLGetConnectAttrW.

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 valid length (in bytes) of the returned attribute value. This length does not include the null terminating character.

If ValuePtr is NULL, no value is returned to *StringLengthPtr.

(4) Return value

This ODBC function returns SQL_SUCCESS, SQL_NO_DATA, 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

08003

Connection does not exist

Y

08S01

Communication link failure

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

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

(6) Notes

If you specify a value for Attribute that is specific to HADB; that is, one that does not exist in the ODBC conventions, include adbodb.h.