Skip to content

SQLGetInfo

SQLGetInfo#

This indicates to return general information of DBMS accessed to application.

SQLGetInfoW() as a Unicode string supports same execution as SQLGetInfo()

Syntax#

SQLRETURN SQLGetInfo(
    SQLHANDLE    ConnectionHandle,
    SQLUSMALLINT InfoType,
    SQLPOINTER   InfoValuePtr,
    SQLSMALLINT  BufferLength,
    SQLSMALLINT  *StringLengthPtr );

Arguments#

Data Type Argument In/Output Description
SQLHANDLE ConnectionHandle Input Database connection handle
SQLUSMALLINT InfoType Input Type of information which you want to search.
The following values are available in addition to the values provided by the ODBC standard.
- ALTIBASE_PROTO_VER: A character string that indicates the protocol version of the Altibase connected by the Altibase CLI driver.
SQLPOINTER InfoValuePtr Output 5 kinds of data are outputted according to data types of buffer pointer which makes data returned:
- 16 bit integer value
- 32 bit integer value
- 32 bit binary value
- 32 bit mask
- Null-terminated Character String
SQLSMALLINT BufferLength Input The byte size of buffer which InfoValuePtr indicates
SQLSMALLINT * StringLengthPtr Output The byte length of result values which InfoValuePtr indicates

Return Values#

SQL_SUCCESS
SQL_SUCCESS_WITH_INFO
SQL_ERROR
SQL_INVALID_HANDLE

Description#

SQLGetInfo() is used to get general information of DBMS. You can get relevant information of each type according to InfoType with this function, and Altibase follows the standard of ODBC.

Diagnosis#

SQLSTATE Description Comments
01004 String data, right truncated The size of returned values is bigger than that of the given buffer.
08003 Disconnection Disconnection Status
08S01 Communication channel error(Data Sending/Recieving Failure) Communication channel error before the function processing is completed between the Altibase CLI driver and the database.
HY000 General error
HY090 Invalid arguments used One value among name length arguments must be under 0 or not be equal to SQL_NTS.
HY096 Out of InfoType range IThe values specified in InfoType are invalid in the version which ODBC provides.