IBM Books

Call Level Interface Guide and Reference

SQLGetInfo - Get General Information

Purpose


Specification: DB2 CLI 1.1 ODBC 1.0 ISO CLI

SQLGetInfo() returns general information, (including supported data conversions) about the DBMS that the application is currently connected to.

Syntax

SQLRETURN   SQLGetInfo       (SQLHDBC           ConnectionHandle,  /* hdbc */
                              SQLUSMALLINT      InfoType,          /* fInfoType */
                              SQLPOINTER        InfoValuePtr,      /* rgbInfoValue */
                              SQLSMALLINT       BufferLength,      /* cbInfoValueMax */
                              SQLSMALLINT  *FAR StringLengthPtr);  /* pcbInfoValue */

Function Arguments

Table 104. SQLGetInfo Arguments
Data Type Argument Use Description
SQLHDBC ConnectionHandle input Database connection handle
SQLUSMALLINT InfoType input The type of information desired. The argument must be one of the values in the first column of the tables in "Data Types and Data Conversion".
SQLPOINTER InfoValuePtr output (also input) Pointer to buffer where this function will store the desired information. Depending on the type of information being retrieved, 5 types of information can be returned:
  • 16 bit integer value
  • 32 bit integer value
  • 32 bit binary value
  • 32 bit mask
  • null-terminated character string
SQLSMALLINT BufferLength input Maximum length of the buffer pointed by InfoValuePtr pointer.
SQLSMALLINT * StringLengthPtr output Pointer to location where this function will return the total number of bytes available to return the desired information. In the case of string output, this size does not include the null terminating character.

If the value in the location pointed to by StringLengthPtr is greater than the size of the InfoValuePtr buffer as specified in BufferLength, then the string output information would be truncated to BufferLength - 1 bytes and the function would return with SQL_SUCCESS_WITH_INFO.

Usage

Refer to Table 105 for a list of the possible values of InfoType and a description of the information that SQLGetInfo() would return for that value.

A number of information types were renamed for DB2 CLI version 5. See "Changes to the InfoTypes in SQLGetInfo()" for the list. Table 105 lists both the old value and the new value.


Table 105. Information Returned By SQLGetInfo
InfoType Format Description and Notes
Note:DB2 CLI returns a value for each InfoType in this table. If the InfoType does not apply or is not supported, the result is dependent on the return type. If the return type is a:
  • Character string containing 'Y' or 'N', "N" is returned.
  • Character string containing a value other than just 'Y' or 'N', an empty string is returned.
  • 16-bit integer, 0 (zero).
  • 32-bit integer, 0 (zero).
  • 32-bit mask, 0 (zero).
SQL_ACCESSIBLE_PROCEDURES string A character string of "Y" indicates that the user can execute all procedures returned by the function SQLProcedures(). "N" indicates there may be procedures returned that the user cannot execute.
SQL_ACCESSIBLE_TABLES string A character string of "Y" indicates that the user is guaranteed SELECT privilege to all tables returned by the function SQLTables(). "N" indicates that there may be tables returned that the user cannot access.
SQL_ACTIVE_ENVIRONMENTS 16-bit integer This InfoType has been replaced with SQL_MAX_CONCURRENT_ACTIVITIES.

The maximum number of active environments that the DB2 CLI driver can support. If there is no specified limit or the limit is unknown, this value is set to zero.

SQL_AGGREGATE_FUNCTIONS 32-bit mask A bitmask enumerating support for aggregation functions:
  • SQL_AF_ALL
  • SQL_AF_AVG
  • SQL_AF_COUNT
  • SQL_AF_DISTINCT
  • SQL_AF_MAX
  • SQL_AF_MIN
  • SQL_AF_SUM
SQL_ALTER_DOMAIN 32-bit mask DB2 CLI returns 0 indicating that the ALTER DOMAIN statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_AD_ADD_CONSTRAINT_DEFERRABLE
  • SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE
  • SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED
  • SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE
  • SQL_AD_ADD_DOMAIN_CONSTRAINT
  • SQL_AD_ADD_DOMAIN_DEFAULT
  • SQL_AD_CONSTRAINT_NAME_DEFINITION
  • SQL_AD_DROP_DOMAIN_CONSTRAINT
  • SQL_AD_DROP_DOMAIN_DEFAULT
SQL_ACTIVE_CONNECTIONS 16-bit integer This InfoType has been replaced with SQL_MAX_DRIVER_CONNECTIONS.

The maximum number of active connections supported per application.

Zero is returned, indicating that the limit is dependent on system resources.

The MAXCONN keyword in the db2cli.ini initialization file or the SQL_ATTR_MAX_CONNECTIONS environment/connection option can be used to impose a limit on the number of connections. This limit is returned if it is set to any value other than zero.

SQL_ACTIVE_STATEMENTS 16-bit integer This InfoType has been replaced with SQL_MAX_CONCURRENT_ACTIVITIES.

The maximum number of active statements per connection.

Zero is returned, indicating that the limit is dependent on database system and DB2 CLI resources, and limits.

SQL_ALTER_TABLE 32-bit mask Indicates which clauses in the ALTER TABLE statement are supported by the DBMS.
  • SQL_AT_ADD_COLUMN_COLLATION
  • SQL_AT_ADD_COLUMN_DEFAULT
  • SQL_AT_ADD_COLUMN_SINGLE
  • SQL_AT_ADD_CONSTRAINT
  • SQL_AT_ADD_TABLE_CONSTRAINT
  • SQL_AT_CONSTRAINT_NAME_DEFINITION
  • SQL_AT_DROP_COLUMN_CASCADE
  • SQL_AT_DROP_COLUMN_DEFAULT
  • SQL_AT_DROP_COLUMN_RESTRICT
  • SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE
  • SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT
  • SQL_AT_SET_COLUMN_DEFAULT
  • SQL_AT_CONSTRAINT_INITIALLY_DEFERRED
  • SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE
  • SQL_AT_CONSTRAINT_DEFERRABLE
  • SQL_AT_CONSTRAINT_NON_DEFERRABLE
SQL_ASYNC_MODE 32-bit unsigned integer Indicates the level of asynchronous support:
  • SQL_AM_CONNECTION, connection level asynchronous execution is supported. Either all statement handles associated with a given connection handle are in asynchronous mode, or all are in synchronous mode. A statement handle on a connection cannot be in asynchronous mode while another statement handle on the same connection is in synchronous mode, and vice versa.
  • SQL_AM_STATEMENT, statement level asynchronous execution is supported. Some statement handles associated with a connection handle can be in asynchronous mode, while other statement handles on the same connection are in synchronous mode.
  • SQL_AM_NONE, asynchronous mode is not supported.

    This value is also returned if the DB2 CLI/ODBC configuration keyword ASYNCENABLE is set to disable asynchronous execution. See "Asynchronous Execution of CLI" for more information.

SQL_BATCH_ROW_COUNT 32-bit mask Indicates how row counts are dealt with. DB2 CLI always returns SQL_BRC_ROLLED_UP indicating that row counts for consecutive INSERT, DELETE, or UPDATE statements are rolled up into one.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_BRC_PROCEDURES
  • SQL_BRC_EXPLICIT
SQL_BATCH_SUPPORT 32-bit mask Indicates which level of batches are supported:
  • SQL_BS_SELECT_EXPLICIT, supports explicit batches that can have result-set generating statements.
  • SQL_BS_ROW_COUNT_EXPLICIT, supports explicit batches that can have row-count generating statements.
  • SQL_BS_SELECT_PROC, supports explicit procedures that can have result-set generating statements.
  • SQL_BS_ROW_COUNT_PROC, supports explicit procedures that can have row-count generating statements.
SQL_BOOKMARK_PERSISTENCE 32-bit mask Indicates when bookmarks remain valid after an operation:
  • SQL_BP_CLOSE, bookmarks are valid after an application calls SQLFreeStmt() with the SQL_CLOSE option, SQLCloseCursor() to close the cursor associated with a statement.
  • SQL_BP_DELETE, the bookmark for a row is valid after that row has been deleted.
  • SQL_BP_DROP, bookmarks are valid after an application calls SQLFreeHandle() with a HandleType of SQL_HANDLE_STMT to drop a statement.
  • SQL_BP_TRANSACTION, bookmarks are valid after an application commits or rolls back a transaction.
  • SQL_BP_UPDATE, the bookmark for a row is valid after any column in that row has been updated, including key columns.
  • SQL_BP_OTHER_HSTMT, a bookmark associated with one statement can be used with another statement. Unless SQL_BP_CLOSE or SQL_BP_DROP is specified, the cursor on the first statement must be open.
  • SQL_BP_DROP is specified, the cursor on the first statement must be open.
SQL_CATALOG_LOCATION 16-bit integer A 16-bit integer value indicated the position of the qualifier in a qualified table name. DB2 CLI always returns SQL_CL_START for this information type. ODBC also defines the value SQL_CL_END which is not returned by DB2 CLI.

In previous versions of DB2 CLI this InfoType was SQL_QUALIFIER_LOCATION.

SQL_CATALOG_NAME string A character string of "Y" indicates that the server supports catalog names. "N" indicates that catalog names are not supported.
SQL_CATALOG_NAME_SEPARATOR string The character(s) used as a separator between a catalog name and the qualified name element that follows it.

In previous versions of DB2 CLI this InfoType was SQL_QUALIFIER_NAME_SEPARATOR.

SQL_CATALOG_TERM string The database vendor's terminology for a qualifier

The name that the vendor uses for the high order part of a three part name.

Since DB2 CLI does not support three part names, a zero-length string is returned.

In previous versions of DB2 CLI this InfoType was SQL_QUALIFIER_TERM.

SQL_CATALOG_USAGE 32-bit mask This is similar to SQL_OWNER_USAGE except that this is used for catalog.

In previous versions of DB2 CLI this InfoType was SQL_QUALIFIER_USAGE.

SQL_COLLATION_SEQ string The name of the collation sequence. This is a character string that indicates the name of the default collation for the default character set for this server (for example ‘ISO 8859-1’ or EBCDIC). If this is unknown, an empty string will be returned.
SQL_COLUMN_ALIAS string Returns "Y" if column aliases are supported, or "N" if they are not.
SQL_CONCAT_NULL_BEHAVIOR 16-bit integer Indicates how the concatenation of NULL valued character data type columns with non-NULL valued character data type columns is handled.
  • SQL_CB_NULL - indicates the result is a NULL value (this is the case for IBM RDBMs).
  • SQL_CB_NON_NULL - indicates the result is a concatenation of non-NULL column values.
SQL_CONVERT_BIGINT     SQL_CONVERT_BINARY     SQL_CONVERT_BIT          SQL_CONVERT_CHAR     SQL_CONVERT_DATE     SQL_CONVERT_DECIMAL     SQL_CONVERT_DOUBLE     SQL_CONVERT_FLOAT     SQL_CONVERT_INTEGER     SQL_CONVERT_INTERVAL_YEAR_MONTH     SQL_CONVERT_INTERVAL_DAY_TIME     SQL_CONVERT_LONGVARBINARY     SQL_CONVERT_LONGVARCHAR     SQL_CONVERT_NUMERIC     SQL_CONVERT_REAL     SQL_CONVERT_SMALLINT     SQL_CONVERT_TIME     SQL_CONVERT_TIMESTAMP     SQL_CONVERT_TINYINT     SQL_CONVERT_VARBINARY     SQL_CONVERT_VARCHAR     32-bit mask Indicates the conversions supported by the data source with the CONVERT scalar function for data of the type named in the InfoType. If the bitmask equals zero, the data source does not support any conversions for the data of the named type, including conversions to the same data type.

For example, to find out if a data source supports the conversion of SQL_INTEGER data to the SQL_DECIMAL data type, an application calls SQLGetInfo() with InfoType of SQL_CONVERT_INTEGER. The application then ANDs the returned bitmask with SQL_CVT_DECIMAL. If the resulting value is nonzero then the conversion is supported.

The following bitmasks are used to determine which conversions are supported:

  • SQL_CVT_BIGINT
  • SQL_CVT_BINARY
  • SQL_CVT_BIT
  • SQL_CVT_CHAR
  • SQL_CVT_DATE
  • SQL_CVT_DECIMAL
  • SQL_CVT_DOUBLE
  • SQL_CVT_FLOAT
  • SQL_CVT_INTEGER
  • SQL_CVT_INTERVAL_YEAR_MONTH
  • SQL_CVT_INTERVAL_DAY_TIME
  • SQL_CVT_LONGVARBINARY
  • SQL_CVT_LONGVARCHAR
  • SQL_CVT_NUMERIC
  • SQL_CVT_REAL
  • SQL_CVT_SMALLINT
  • SQL_CVT_TIME
  • SQL_CVT_TIMESTAMP
  • SQL_CVT_TINYINT
  • SQL_CVT_VARBINARY
  • SQL_CVT_VARCHAR
SQL_CONVERT_FUNCTIONS 32-bit mask Indicates the scalar conversion functions supported by the driver and associated data source.

DB2 CLI Version 2.1.1 and later supports ODBC scalar conversions between char variables (CHAR, VARCHAR, LONG VARCHAR and CLOB) and DOUBLE (or FLOAT).

  • SQL_FN_CVT_CONVERT - used to determine which conversion functions are supported.
SQL_CORRELATION_NAME 16-bit integer Indicates the degree of correlation name support by the server:
  • SQL_CN_ANY, supported and can be any valid user-defined name.
  • SQL_CN_NONE, correlation name not supported.
  • SQL_CN_DIFFERENT, correlation name supported but it must be different than the name of the table that it represent.
SQL_CREATE_ASSERTION 32-bit mask Indicates which clauses in the CREATE ASSERTION statement are supported by the DBMS. DB2 CLI always returns zero; the CREATE ASSERTION statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA_CREATE_ASSERTION
  • SQL_CA_CONSTRAINT_INITIALLY_DEFERRED
  • SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE
  • SQL_CA_CONSTRAINT_DEFERRABLE
  • SQL_CA_CONSTRAINT_NON_DEFERRABLE
SQL_CREATE_CHARACTER_SET 32-bit mask Indicates which clauses in the CREATE CHARACTER SET statement are supported by the DBMS. DB2 CLI always returns zero; the CREATE CHARACTER SET statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CCS_CREATE_CHARACTER_SET
  • SQL_CCS_COLLATE_CLAUSE
  • SQL_CCS_LIMITED_COLLATION
SQL_CREATE_COLLATION 32-bit mask Indicates which clauses in the CREATE COLATION statement are supported by the DBMS. DB2 CLI always returns zero; the CREATE COLLATION statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CCOL_CREATE_COLLATION
SQL_CREATE_DOMAIN 32-bit mask Indicates which clauses in the CREATE DOMAIN statement are supported by the DBMS. DB2 CLI always returns zero; the CREATE DOMAIN statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CDO_CREATE_DOMAIN
  • SQL_CDO_CONSTRAINT_NAME_DEFINITION
  • SQL_CDO_DEFAULT
  • SQL_CDO_CONSTRAINT
  • SQL_CDO_COLLATION
  • SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED
  • SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE
  • SQL_CDO_CONSTRAINT_DEFERRABLE
  • SQL_CDO_CONSTRAINT_NON_DEFERRABLE
SQL_CREATE_SCHEMA 32-bit mask Indicates which clauses in the CREATE SCHEMA statement are supported by the DBMS:
  • SQL_CS_CREATE_SCHEMA
  • SQL_CS_AUTHORIZATION
  • SQL_CS_DEFAULT_CHARACTER_SET
SQL_CREATE_TABLE 32-bit mask Indicates which clauses in the CREATE TABLE statement are supported by the DBMS.

The following bitmasks are used to determine which clauses are supported:

  • SQL_CT_CREATE_TABLE
  • SQL_CT_TABLE_CONSTRAINT
  • SQL_CT_CONSTRAINT_NAME_DEFINITION

The following bits specify the ability to create temporary tables:

  • SQL_CT_COMMIT_PRESERVE, deleted rows are preserved on commit.
  • SQL_CT_COMMIT_DELETE, deleted rows are deleted on commit.
  • SQL_CT_GLOBAL_TEMPORARY, global temporary tables can be created.
  • SQL_CT_LOCAL_TEMPORARY, local temporary tables can be created.

The following bits specify the ability to create column constraints:

  • SQL_CT_COLUMN_CONSTRAINT, specifying column constraints is supported.
  • SQL_CT_COLUMN_DEFAULT, specifying column defaults is supported.
  • SQL_CT_COLUMN_COLLATION, specifying column collation is supported.

The following bits specify the supported constraint attributes if specifying column or table constraints is supported:

  • SQL_CT_CONSTRAINT_INITIALLY_DEFERRED
  • SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE
  • SQL_CT_CONSTRAINT_DEFERRABLE
  • SQL_CT_CONSTRAINT_NON_DEFERRABLE
SQL_CREATE_TRANSLATION 32-bit mask Indicates which clauses in the CREATE TRANSLATION statement are supported by the DBMS. DB2 CLI always returns zero; the CREATE TRANSLATION statement is not supported.

ODBC also defines the following value that is not returned by DB2 CLI:

  • SQL_CTR_CREATE_TRANSLATION
SQL_CREATE_VIEW 32-bit mask Indicates which clauses in the CREATE VIEW statement are supported by the DBMS:
  • SQL_CV_CREATE_VIEW
  • SQL_CV_CHECK_OPTION
  • SQL_CV_CASCADED
  • SQL_CV_LOCAL
supported.
SQL_CURSOR_CLOSE_BEHAVIOR 32-bit unsigned integer Indicates whether or not locks are released when the cursor is closed. The possible values are:
  • SQL_CC_NO_RELEASE: locks are not released when the cursor on this statement handle is closed. This is the default.
  • SQL_CC_RELEASE: locks are released when the cursor on this statement handle is closed.

Typically cursors are explicitly closed when the function SQLFreeStmt() is called with the SQL_CLOSE or SQL_DROP option. In addition, the end of the transaction (when a commit or rollback is issued) may also cause the closing of the cursor (depending on the WITH HOLD attribute currently in use).

SQL_CURSOR_COMMIT_BEHAVIOR 16-bit integer Indicates how a COMMIT operation affects cursors. A value of:
  • SQL_CB_DELETE, destroy cursors and drops access plans for dynamic SQL statements.
  • SQL_CB_CLOSE, destroy cursors, but retains access plans for dynamic SQL statements (including non-query statements)
  • SQL_CB_PRESERVE, retains cursors and access plans for dynamic statements (including non-query statements). Applications can continue to fetch data, or close the cursor and re-execute the query without re-preparing the statement.
    Note:After COMMIT, a FETCH must be issued to reposition the cursor before actions such as positioned updates or deletes can be taken.
SQL_CURSOR_ROLLBACK_BEHAVIOR 16-bit integer Indicates how a ROLLBACK operation affects cursors. A value of:
  • SQL_CB_DELETE, destroy cursors and drops access plans for dynamic SQL statements.
  • SQL_CB_CLOSE, destroy cursors, but retains access plans for dynamic SQL statements (including non-query statements)
  • SQL_CB_PRESERVE, retains cursors and access plans for dynamic statements (including non-query statements). Applications can continue to fetch data, or close the cursor and re-execute the query without re-preparing the statement.
    Note:DB2 servers do not have the SQL_CB_PRESERVE property.
SQL_CURSOR_SENSITIVITY 32-bit unsigned integer Indicates support for cursor sensitivity:

  • SQL_INSENSITIVE, all cursors on the statement handle show the result set without reflecting any changes made to it by any other cursor within the same transaction.

  • SQL_UNSPECIFIED, tt is unspecified whether cursors on the statement handle make visible the changes made to a result set by another cursor within the same transaction. Cursors on the statement handle may make visible none, some, or all such changes.

  • SQL_SENSITIVE, cursors are sensitive to changes made by other cursors within the same transaction.
SQL_DATA_SOURCE_NAME string The name used as data source on the input to SQLConnect(), or the DSN keyword value in the SQLDriverConnect() connection string.
SQL_DATA_SOURCE_READ_ONLY string A character string of "Y" indicates that the database is set to READ ONLY mode, "N" indicates that is not set to READ ONLY mode.
SQL_DATABASE_NAME string The name of the current database in use
Note:also returned by SELECT CURRENT SERVER on IBM DBMS's.
SQL_DATETIME_LITERALS 32-bit unsigned integer Indicates the datetime literals that are supported by the DBMS. DB2 CLI always returns zero; datetime literals are not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_DL_SQL92_DATE
  • SQL_DL_SQL92_TIME
  • SQL_DL_SQL92_TIMESTAMP
  • SQL_DL_SQL92_INTERVAL_YEAR
  • SQL_DL_SQL92_INTERVAL_MONTH
  • SQL_DL_SQL92_INTERVAL_DAY
  • SQL_DL_SQL92_INTERVAL_HOUR
  • SQL_DL_SQL92_INTERVAL_MINUTE
  • SQL_DL_SQL92_INTERVAL_SECOND
  • SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH
  • SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR
  • SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE
  • SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND
  • SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE
  • SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND
  • SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND
SQL_DBMS_NAME string The name of the DBMS product being accessed

For example:

  • "DB2/6000"
  • "DB2/2"
SQL_DBMS_VER string The Version of the DBMS product accessed. A string of the form 'mm.vv.rrrr' where mm is the major version, vv is the minor version and rrrr is the release. For example, "0r.01.0000" translates to major version r, minor version 1, release 0.
SQL_DDL_INDEX 32-bit unsigned integer Indicates support for the creation and dropping of indexes:
  • SQL_DI_CREATE_INDEX
  • SQL_DI_DROP_INDEX
SQL_DEFAULT_TXN_ISOLATION 32-bit mask The default transaction isolation level supported

One of the following masks are returned:

  • SQL_TXN_READ_UNCOMMITTED = Changes are immediately perceived by all transactions (dirty read, non-repeatable read, and phantoms are possible).

    This is equivalent to IBM's UR level.

  • SQL_TXN_READ_COMMITTED = Row read by transaction 1 can be altered and committed by transaction 2 (non-repeatable read and phantoms are possible)

    This is equivalent to IBM's CS level.

  • SQL_TXN_REPEATABLE_READ = A transaction can add or remove rows matching the search condition or a pending transaction (repeatable read, but phantoms are possible)

    This is equivalent to IBM's RS level.

  • SQL_TXN_SERIALIZABLE = Data affected by pending transaction is not available to other transactions (repeatable read, phantoms are not possible)

    This is equivalent to IBM's RR level.

  • SQL_TXN_VERSIONING = Not applicable to IBM DBMSs.

  • SQL_TXN_NOCOMMIT = Any chnages are effectively committed at the end of a successful operation; no explicit commit or rollback is allowed.

    This is a DB2 for AS/400 isolation level.

In IBM terminology,

  • SQL_TXN_READ_UNCOMMITTED is Uncommitted Read;
  • SQL_TXN_READ_COMMITTED is Cursor Stability;
  • SQL_TXN_REPEATABLE_READ is Read Stability;
  • SQL_TXN_SERIALIZABLE is Repeatable Read.
SQL_DESCRIBE_PARAMETER string "Y" if parameters can be described; "N" if not.
SQL_DM_VER string Reserved.
SQL_DRIVER_HDBC 32 bits DB2 CLI's database handle
SQL_DRIVER_HDESC 32 bits DB2 CLI's descriptor handle
SQL_DRIVER_HENV 32 bits DB2 CLI's environment handle
SQL_DRIVER_HLIB 32 bits Reserved.
SQL_DRIVER_HSTMT 32 bits DB2 CLI's statement handle

In an ODBC environment with an ODBC Driver Manager, if InfoType is set to SQL_DRIVER_HSTMT, the Driver Manager statement handle (i.e. the one returned from SQLAllocStmt()) must be passed on input in rgbInfoValue from the application. In this case rgbInfoValue is both an input and an output argument. The ODBC Driver Manager is responsible for returning the mapped value. ODBC applications wishing to call DB2 CLI specific functions (such as the LOB functions) can access them, by passing these handle values to the functions after loading the DB2 CLI library and issuing an operating system call to invoke the desired functions.

SQL_DRIVER_NAME string The file name of the DB2 CLI implementation.
SQL_DRIVER_ODBC_VER string The version number of ODBC that the Driver supports. DB2 CLI will return "03.00".
SQL_DRIVER_VER string The version of the CLI driver. A string of the form 'mm.vv.rrrr' where mm is the major version, vv is the minor version and rrrr is the release. For example, "05.01.0000" translates to major version 5, minor version 1, release 0.
SQL_DROP_ASSERTION 32-bit unsigned integer Indicates which clause in the DROP ASSERTION statement is supported by the DBMS. DB2 CLI always returns zero; the DROP ASSERTION statement is not supported.

ODBC also defines the following value that is not returned by DB2 CLI:

  • SQL_DA_DROP_ASSERTION
SQL_DROP_CHARACTER_SET 32-bit unsigned integer Indicates which clause in the DROP CHARACTER SET statement is supported by the DBMS. DB2 CLI always returns zero; the DROP CHARACTER SET statement is not supported.

ODBC also defines the following value that is not returned by DB2 CLI:

  • SQL_DCS_DROP_CHARACTER_SET
SQL_DROP_COLLATION 32-bit unsigned integer Indicates which clause in the DROP COLLATION statement is supported by the DBMS. DB2 CLI always returns zero; the DROP COLLATION statement is not supported.

ODBC also defines the following value that is not returned by DB2 CLI:

  • SQL_DC_DROP_COLLATION
SQL_DROP_DOMAIN 32-bit unsigned integer Indicates which clauses in the DROP DOMAIN statement are supported by the DBMS. DB2 CLI always returns zero; the DROP DOMAIN statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_DD_DROP_DOMAIN
  • SQL_DD_CASCADE
  • SQL_DD_RESTRICT
SQL_DROP_SCHEMA 32-bit unsigned integer Indicates which clauses in the DROP SCHEMA statement are supported by the DBMS. DB2 CLI always returns zero; the DROP SCHEMA statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_DS_DROP_SCHEMA
  • SQL_DS_CASCADE
  • SQL_DS_RESTRICT
SQL_DROP_TABLE 32-bit unsigned integer Indicates which clauses in the DROP TABLE statement are supported by the DBMS:
  • SQL_DT_DROP_TABLE
  • SQL_DT_CASCADE
  • SQL_DT_RESTRICT
SQL_DROP_TRANSLATION 32-bit unsigned integer Indicates which clauses in the DROP TRANSLATION statement are supported by the DBMS. DB2 CLI always returns zero; the DROP TRANSLATION statement is not supported.

ODBC also defines the following value that is not returned by DB2 CLI:

  • SQL_DTR_DROP_TRANSLATION
SQL_DROP_VIEW 32-bit unsigned integer Indicates which clauses in the DROP VIEW statement are supported by the DBMS. DB2 CLI always returns zero; the DROP VIEW statement is not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_DV_DROP_VIEW
  • SQL_DV_CASCADE
  • SQL_DV_RESTRICT
SQL_DYNAMIC_CURSOR_ATTRIBUTES1 32-bit mask Indicates the attributes of a dynamic cursor (subset 1 of 2). DB2 CLI always returns zero; dynamic cursors are not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA1_NEXT
  • SQL_CA1_ABSOLUTE
  • SQL_CA1_RELATIVE
  • SQL_CA1_BOOKMARK
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_UNLOCK
  • SQL_CA1_POS_POSITION
  • SQL_CA1_POS_UPDATE
  • SQL_CA1_POS_DELETE
  • SQL_CA1_POS_REFRESH
  • SQL_CA1_POSITIONED_UPDATE
  • SQL_CA1_POSITIONED_DELETE
  • SQL_CA1_SELECT_FOR_UPDATE
  • SQL_CA1_BULK_ADD
  • SQL_CA1_BULK_UPDATE_BY_BOOKMARK
  • SQL_CA1_BULK_DELETE_BY_BOOKMARK
  • SQL_CA1_BULK_FETCH_BY_BOOKMARK
SQL_DYNAMIC_CURSOR_ATTRIBUTES2 32-bit mask Indicates the attributes of a dynamic cursor (subset 2 of 2). DB2 CLI always returns zero; dynamic cursors are not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA2_READ_ONLY_CONCURRENCY
  • SQL_CA2_LOCK_CONCURRENCY
  • SQL_CA2_OPT_ROWVER_CONCURRENCY
  • SQL_CA2_OPT_VALUES_CONCURRENCY
  • SQL_CA2_SENSITIVITY_ADDITIONS
  • SQL_CA2_SENSITIVITY_DELETIONS
  • SQL_CA2_SENSITIVITY_UPDATES
  • SQL_CA2_MAX_ROWS_SELECT
  • SQL_CA2_MAX_ROWS_INSERT
  • SQL_CA2_MAX_ROWS_DELETE
  • SQL_CA2_MAX_ROWS_UPDATE
  • SQL_CA2_MAX_ROWS_CATALOG
  • SQL_CA2_MAX_ROWS_AFFECTS_ALL
  • SQL_CA2_CRC_EXACT
  • SQL_CA2_CRC_APPROXIMATE
  • SQL_CA2_SIMULATE_NON_UNIQUE
  • SQL_CA2_SIMULATE_TRY_UNIQUE
  • SQL_CA2_SIMULATE_UNIQUE
SQL_EXPRESSIONS_IN_ORDERBY string The character string "Y" indicates the database server supports the DIRECT specification of expressions in the ORDER BY list, "N" indicates that is does not.
SQL_FETCH_DIRECTION 32-bit mask The supported fetch directions.

The following bit-masks are used in conjunction with the flag to determine which options are supported.

  • SQL_FD_FETCH_NEXT
  • SQL_FD_FETCH_FIRST
  • SQL_FD_FETCH_LAST
  • SQL_FD_FETCH_PREV
  • SQL_FD_FETCH_ABSOLUTE
  • SQL_FD_FETCH_RELATIVE
  • SQL_FD_FETCH_RESUME
SQL_FILE_USAGE 16-bit integer Indicates how a single-tier driver directly treats files in a data source. The DB2 CLI driver is not a single-tier driver and therefor always returns SQL_FILE_NOT_SUPPORTED.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_FILE_TABLE
  • SQL_FILE_CATALOG
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 32-bit mask Indicates the supported attributes of a forward-only cursor (subset 1 of 2).
  • SQL_CA1_NEXT
  • SQL_CA1_POSITIONED_UPDATE
  • SQL_CA1_POSITIONED_DELETE
  • SQL_CA1_SELECT_FOR_UPDATE

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_UNLOCK
  • SQL_CA1_POS_POSITION
  • SQL_CA1_POS_UPDATE
  • SQL_CA1_POS_DELETE
  • SQL_CA1_POS_REFRESH
  • SQL_CA1_BULK_ADD
  • SQL_CA1_BULK_UPDATE_BY_BOOKMARK
  • SQL_CA1_BULK_DELETE_BY_BOOKMARK
  • SQL_CA1_BULK_FETCH_BY_BOOKMARK
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 32-bit mask Indicates the supported attributes of a forward-only cursor (subset 2 of 2).
  • SQL_CA2_READ_ONLY_CONCURRENCY
  • SQL_CA2_LOCK_CONCURRENCY
  • SQL_CA2_MAX_ROWS_SELECT
  • SQL_CA2_MAX_ROWS_CATALOG

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA2_OPT_ROWVER_CONCURRENCY
  • SQL_CA2_OPT_VALUES_CONCURRENCY
  • SQL_CA2_SENSITIVITY_ADDITIONS
  • SQL_CA2_SENSITIVITY_DELETIONS
  • SQL_CA2_SENSITIVITY_UPDATES
  • SQL_CA2_MAX_ROWS_INSERT
  • SQL_CA2_MAX_ROWS_DELETE
  • SQL_CA2_MAX_ROWS_UPDATE
  • SQL_CA2_MAX_ROWS_AFFECTS_ALL
  • SQL_CA2_CRC_EXACT
  • SQL_CA2_CRC_APPROXIMATE
  • SQL_CA2_SIMULATE_NON_UNIQUE
  • SQL_CA2_SIMULATE_TRY_UNIQUE
  • SQL_CA2_SIMULATE_UNIQUE
SQL_GETDATA_EXTENSIONS 32-bit mask Indicates whether extensions to the SQLGetData() function are supported. The following extensions are currently identified and supported by DB2 CLI:
  • SQL_GD_ANY_COLUMN, SQLGetData() can be called for unbound columns that precede the last bound column.
  • SQL_GD_ANY_ORDER, SQLGetData() can be called for columns in any order.
  • SQL_GD_BLOCK, SQLGetData() can be called for bound columns as well as unbound columns.

ODBC also defines SQL_GD_BOUND which is not returned by DB2 CLI.

SQL_GROUP_BY 16-bit integer Indicates the degree of support for the GROUP BY clause by the server:
  • SQL_GB_NO_RELATION, there is no relationship between the columns in the GROUP BY and in the SELECT list
  • SQL_GB_NOT_SUPPORTED, GROUP BY not supported
  • SQL_GB_GROUP_BY_EQUALS_SELECT, GROUP BY must include all non-aggregated columns in the select list.
  • SQL_GB_GROUP_BY_CONTAINS_SELECT, the GROUP BY clause must contain all non-aggregated columns in the SELECT list.
  • SQL_GB_COLLATE, a COLLATE clause can be specified at the end of each grouping column.
SQL_IDENTIFIER_CASE 16-bit integer Indicates case sensitivity of object names (such as table-name).

A value of:

  • SQL_IC_UPPER = identifier names are stored in upper case in the system catalog.
  • SQL_IC_LOWER = identifier names are stored in lower case in the system catalog.
  • SQL_IC_SENSITIVE = identifier names are case sensitive, and are stored in mixed case in the system catalog.
  • SQL_IC_MIXED = identifier names are not case sensitive, and are stored in mixed case in the system catalog.
Note:Identifier names in IBM DBMSs are not case sensitive.
SQL_IDENTIFIER_QUOTE_CHAR string Indicates the character used to surround a delimited identifier
SQL_INDEX_KEYWORDS 32-bit mask Indicates the keywords in the CREATE INDEX statement that are supported:
  • SQL_IK_NONE, none of the keywords are supported.
  • SQL_IK_ASC, ASC keyword is supported.
  • SQL_IK_DESC, DESC keyword is supported.
  • SQL_IK_ALL, all keywords are supported.
call SQLGetInfo() with the SQL_DLL_INDEX InfoType.
SQL_INFO_SCHEMA_VIEWS 32-bit mask Indicates the views in the INFORMATIONAL_SCHEMA that are supported. DB2 CLI always returns zero; no views in the INFORMATIONAL_SCHEMA are supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_ISV_ASSERTIONS
  • SQL_ISV_CHARACTER_SETS
  • SQL_ISV_CHECK_CONSTRAINTS
  • SQL_ISV_COLLATIONS
  • SQL_ISV_COLUMN_DOMAIN_USAGE
  • SQL_ISV_COLUMN_PRIVILEGES
  • SQL_ISV_COLUMNS
  • SQL_ISV_CONSTRAINT_COLUMN_USAGE
  • SQL_ISV_CONSTRAINT_TABLE_USAGE
  • SQL_ISV_DOMAIN_CONSTRAINTS
  • SQL_ISV_DOMAINS
  • SQL_ISV_KEY_COLUMN_USAGE
  • SQL_ISV_REFERENTIAL_CONSTRAINTS
  • SQL_ISV_SCHEMATA
  • SQL_ISV_SQL_LANGUAGES
  • SQL_ISV_TABLE_CONSTRAINTS
  • SQL_ISV_TABLE_PRIVILEGES
  • SQL_ISV_TABLES
  • SQL_ISV_TRANSLATIONS
  • SQL_ISV_USAGE_PRIVILEGES
  • SQL_ISV_VIEW_COLUMN_USAGE
  • SQL_ISV_VIEW_TABLE_USAGE
  • SQL_ISV_VIEWS
SQL_INSERT_STATEMENT 32-bit mask Indicates support for INSERT statements:
  • SQL_IS_INSERT_LITERALS
  • SQL_IS_INSERT_SEARCHED
  • SQL_IS_SELECT_INTO
SQL_INTEGRITY string The "Y" character string indicates that the data source supports Integrity Enhanced Facility (IEF) in SQL89 and in X/Open XPG4 Embedded SQL, an "N" indicates it does not.

In previous versions of DB2 CLI this InfoType was SQL_ODBC_SQL_OPT_IEF.

SQL_KEYSET_CURSOR_ATTRIBUTES1 32-bit mask Indicates the supported attributes of a keyset cursor (subset 1 of 2). DB2 CLI always returns zero; keyset cursors are not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA1_NEXT
  • SQL_CA1_ABSOLUTE
  • SQL_CA1_RELATIVE
  • SQL_CA1_BOOKMARK
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_UNLOCK
  • SQL_CA1_POS_POSITION
  • SQL_CA1_POS_UPDATE
  • SQL_CA1_POS_DELETE
  • SQL_CA1_POS_REFRESH
  • SQL_CA1_POSITIONED_UPDATE
  • SQL_CA1_POSITIONED_DELETE
  • SQL_CA1_SELECT_FOR_UPDATE
  • SQL_CA1_BULK_ADD
  • SQL_CA1_BULK_UPDATE_BY_BOOKMARK
  • SQL_CA1_BULK_DELETE_BY_BOOKMARK
  • SQL_CA1_BULK_FETCH_BY_BOOKMARK
SQL_KEYSET_CURSOR_ATTRIBUTES2 32-bit mask Indicates the supported attributes of a keyset cursor (subset 2 of 2). DB2 CLI always returns zero; keyset cursors are not supported.

ODBC also defines the following values that are not returned by DB2 CLI:

  • SQL_CA2_READ_ONLY_CONCURRENCY
  • SQL_CA2_LOCK_CONCURRENCY
  • SQL_CA2_OPT_ROWVER_CONCURRENCY
  • SQL_CA2_OPT_VALUES_CONCURRENCY
  • SQL_CA2_SENSITIVITY_ADDITIONS
  • SQL_CA2_SENSITIVITY_DELETIONS
  • SQL_CA2_SENSITIVITY_UPDATES
  • SQL_CA2_MAX_ROWS_SELECT
  • SQL_CA2_MAX_ROWS_INSERT
  • SQL_CA2_MAX_ROWS_DELETE
  • SQL_CA2_MAX_ROWS_UPDATE
  • SQL_CA2_MAX_ROWS_CATALOG
  • SQL_CA2_MAX_ROWS_AFFECTS_ALL
  • SQL_CA2_CRC_EXACT
  • SQL_CA2_CRC_APPROXIMATE
  • SQL_CA2_SIMULATE_NON_UNIQUE
  • SQL_CA2_SIMULATE_TRY_UNIQUE
  • SQL_CA2_SIMULATE_UNIQUE
SQL_KEYWORDS sting This is a string of all the keywords at the DBMS that are not in the ODBC's list of reserved words.
SQL_LIKE_ESCAPE_CLAUSE string A character string that indicates if an escape character is supported for the metacharacters percent and underscore in a LIKE predicate.
SQL_LOCK_TYPES 32-bit mask Reserved option, zero is returned for the bit-mask.
SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 32-bit unsigned integer The maximum number of active concurrent statements in asynchronous mode that DB2 CLI can support on a given connection. This value is zero if there is no specific limit, or the limit is unknown.
SQL_MAX_BINARY_LITERAL_LEN 32-bit unsigned integer A 32-bit unsigned integer value specifying the maximum length of a hexadecimal literal in a SQL statement.
SQL_MAX_CATALOG_NAME_LEN 16-bit integer The maximum length of a catalog name in the data source. This value is zero if there is no maximum length, or the length is unknown.

In previous versions of DB2 CLI this fInfoType was SQL_MAX_QUALIFIER_NAME_LEN.

SQL_MAX_CHAR_LITERAL_LEN 32-bit unsigned integer The maximum length of a character literal in an SQL statement (in bytes).
SQL_MAX_COLUMN_NAME_LEN 16-bit integer The maximum length of a column name (in bytes)
SQL_MAX_COLUMNS_IN_GROUP_BY 16-bit integer Indicates the maximum number of columns that the server supports in a GROUP BY clause. Zero if no limit.
SQL_MAX_COLUMNS_IN_INDEX 16-bit integer Indicates the maximum number of columns that the server supports in an index. Zero if no limit.
SQL_MAX_COLUMNS_IN_ORDER_BY 16-bit integer Indicates the maximum number of columns that the server supports in an ORDER BY clause. Zero if no limit.
SQL_MAX_COLUMNS_IN_SELECT 16-bit integer Indicates the maximum number of columns that the server supports in a select list. Zero if no limit.
SQL_MAX_COLUMNS_IN_TABLE 16-bit integer Indicates the maximum number of columns that the server supports in a base table. Zero if no limit.
SQL_MAX_CONCURRENT_ACTIVITIES 16-bit integer The maximum number of active environments that the DB2 CLI driver can support. If there is no specified limit or the limit is unknown, this value is set to zero.

In previous versions of DB2 CLI this InfoType was SQL_ACTIVE_ENVIRONMENTS.

SQL_MAX_CURSOR_NAME_LEN 16-bit integer The maximum length of a cursor name (in bytes). This value is zero if there is no maximum length, or the length is unknown.
SQL_MAX_DRIVER_CONNECTIONS 16-bit integer The maximum number of active connections supported per application.

Zero is returned, indicating that the limit is dependent on system resources.

The MAXCONN keyword in the db2cli.ini initialization file or the SQL_ATTR_MAX_CONNECTIONS environment/connection option can be used to impose a limit on the number of connections. This limit is returned if it is set to any value other than zero.

In previous versions of DB2 CLI this InfoType was SQL_ACTIVE_CONNECTIONS.

SQL_MAX_IDENTIFIER_LEN 16-bit integer The maximum size (in characters) that the data source supports for user-defined names.
SQL_MAX_INDEX_SIZE 32-bit unsigned integer Indicates the maximum size in bytes that the server supports for the combined columns in an index. Zero if no limit.
SQL_MAX_OWNER_NAME_LEN 16-bit integer This fInfoType has been replaced with SQL_MAX_SCHEMA_NAME_LEN.

The maximum length of a schema qualifier name (in bytes).

SQL_MAX_PROCEDURE_NAME_LEN 16-bit integer The maximum length of a procedure name (in bytes).
SQL_MAX_QUALIFIER_NAME_LEN 16-bit integer This fInfoType has been replaced with SQL_MAX_CATALOG_NAME_LEN.

The maximum length of a catalog qualifier name; first part of a 3 part table name (in bytes).

SQL_MAX_ROW_SIZE 32-bit unsigned integer Specifies the maximum length in bytes that the server supports in single row of a base table. Zero if no limit.
SQL_MAX_ROW_SIZE_INCLUDES_LONG string Set to "Y" to indicate that the value returned by SQL_MAX_ROW_SIZE InfoType includes the length of product-specific long string data types. Otherwise, set to "N".
SQL_MAX_SCHEMA_NAME_LEN 16-bit integer The maximum length of a schema qualifier name (in bytes).

In previous versions of DB2 CLI this fInfoType was SQL_MAX_OWNER_NAME_LEN.

SQL_MAX_STATEMENT_LEN 32-bit unsigned integer Indicates the maximum length of an SQL statement string in bytes, including the number of white spaces in the statement.
SQL_MAX_TABLE_NAME_LEN 16-bit integer The maximum length of a table name (in bytes).
SQL_MAX_TABLES_IN_SELECT 16-bit integer Indicates the maximum number of table names allowed in a FROM clause in a <query specification>.
SQL_MAX_USER_NAME_LEN 16-bit integer Indicates the maximum size allowed for a <user identifier> (in bytes).
SQL_MULT_RESULT_SETS string The character string "Y" indicates that the database supports multiple result sets, "N" indicates that it does not.
SQL_MULTIPLE_ACTIVE_TXN string The character string "Y" indicates that active transactions on multiple connections are allowed, "N" indicates that only one connection at a time can have an active transaction.

DB2 CLI returns "N" for coordinated distributed unit of work (CONNECT TYPE 2) connections, (since the transaction or Unit Of Work spans all connections), and returns "Y" for all other connections.

SQL_NEED_LONG_DATA_LEN string A character string reserved for the use of ODBC. "N is" always returned.
SQL_NON_NULLABLE_COLUMNS 16-bit integer Indicates whether non-nullable columns are supported:
  • SQL_NNC_NON_NULL, columns can be defined as NOT NULL.
  • SQL_NNC_NULL, columns can not be defined as NOT NULL.
SQL_NULL_COLLATION 16-bit integer Indicates where NULLs are sorted in a list:
  • SQL_NC_HIGH, null values sort high
  • SQL_NC_LOW, to indicate that null values sort low
SQL_NUMERIC_FUNCTIONS 32-bit mask Indicates the ODBC scalar numeric functions supported These functions are intended to be used with the ODBC vendor escape sequence described in "Using Vendor Escape Clauses".

The following bit-masks are used to determine which numeric functions are supported:

  • SQL_FN_NUM_ABS
  • SQL_FN_NUM_ACOS
  • SQL_FN_NUM_ASIN
  • SQL_FN_NUM_ATAN
  • SQL_FN_NUM_ATAN2
  • SQL_FN_NUM_CEILING
  • SQL_FN_NUM_COS
  • SQL_FN_NUM_COT
  • SQL_FN_NUM_DEGREES
  • SQL_FN_NUM_EXP
  • SQL_FN_NUM_FLOOR
  • SQL_FN_NUM_LOG
  • SQL_FN_NUM_LOG10
  • SQL_FN_NUM_MOD
  • SQL_FN_NUM_PI
  • SQL_FN_NUM_POWER
  • SQL_FN_NUM_RADIANS
  • SQL_FN_NUM_RAND
  • SQL_FN_NUM_ROUND
  • SQL_FN_NUM_SIGN
  • SQL_FN_NUM_SIN
  • SQL_FN_NUM_SQRT
  • SQL_FN_NUM_TAN
  • SQL_FN_NUM_TRUNCATE
SQL_ODBC_API_CONFORMANCE 16-bit integer The level of ODBC conformance.
  • SQL_OAC_NONE
  • SQL_OAC_LEVEL1
  • SQL_OAC_LEVEL2
SQL_ODBC_INTERFACE_CONFORMANCE 32-bit unsigned integer Indicates the level of the ODBC 3.0 interface that the DB2 CLI driver conforms to:
  • SQL_OIC_CORE, the minimum level that all ODBC drivers are expected to conform to. This level includes basic interface elements such as connection functions; functions for preparing and executing an SQL statement; basic result set metadata functions; basic catalog functions; and so on.
  • SQL_OIC_LEVEL1, a level including the core standards compliance level functionality, plus scrollable cursors, bookmarks, positioned updates and deletes, and so on.
  • SQL_OIC_LEVEL2, a level including level 1 standards compliance level functionality, plus advanced features such as sensitive cursors; update, delete, and refresh by bookmarks; stored procedure support; catalog functions for primary and foreign keys; multi-catalog support; and so on.
SQL_SCHEMA_TERM string The database vendor's terminology for a schema (owner).

In previous versions of DB2 CLI this InfoType was SQL_OWNER_TERM.

SQL_SCHEMA_USAGE 32-bit mask Indicates the type of SQL statements that have schema (owners) associated with them when these statements are executed, Schema qualifiers (owners) are:
  • SQL_SU_DML_STATEMENTS - supported in all DML statements.
  • SQL_SU_PROCEDURE_INVOCATION - supported in the procedure invocation statement.
  • SQL_SU_TABLE_DEFINITION - supported in all table definition statements.
  • SQL_SU_INDEX_DEFINITION - supported in all index definition statements.
  • SQL_SU_PRIVILEGE_DEFINITION - supported in all privilege definition statements (i.e. grant and revoke statements).

In previous versions of DB2 CLI this InfoType was SQL_OWNER_USAGE.

SQL_ODBC_SAG_CLI_CONFORMANCE 16-bit integer The compliance to the functions of the SQL Access Group (SAG) CLI specification.

A value of:

  • SQL_OSCC_NOT_COMPLIANT - the driver is not SAG-compliant.
  • SQL_OSCC_COMPLIANT - the driver is SAG-compliant.
SQL_ODBC_SQL_CONFORMANCE 16-bit integer A value of:
  • SQL_OSC_MINIMUM, minimum ODBC SQL grammar supported
  • SQL_OSC_CORE, core ODBC SQL Grammar supported
  • SQL_OSC_EXTENDED, extended ODBC SQL Grammar supported

For the definition of the above 3 types of ODBC SQL grammar, see the ODBC 3.0 Software Development Kit and Programmer's Reference

SQL_ODBC_SQL_OPT_IEF string This InfoType has been replaced with SQL_INTEGRITY.

The "Y" character string indicates that the data source supports Integrity Enhanced Facility (IEF) in SQL89 and in X/Open XPG4 Embedded SQL, an "N" indicates it does not.

SQL_ODBC_VER string The version number of ODBC that the driver manager supports.

DB2 CLI will return the string "03.01.0000".

SQL_OJ_CAPABILITIES 32-bit mask A 32-bit bit-mask enumerating the types of outer join supported.

The bitmasks are:

  • SQL_OJ_LEFT : Left outer join is supported.
  • SQL_OJ_RIGHT : Right outer join is supported.
  • SQL_OJ_FULL : Full outer join is supported.
  • SQL_OJ_NESTED : Nested outer join is supported.
  • SQL_OJ_ORDERED : The order of the tables underlying the columns in the outer join ON clause need not be in the same order as the tables in the JOIN clause.
  • SQL_OJ_INNER : The inner table of an outer join can also be an inner join.
  • SQL_OJ_ALL_COMPARISONS : Any predicate may be used in the outer join ON clause. If this bit is not set, the equality (=) operator is the only valid comparison operator in the ON clause.
SQL_ORDER_BY_COLUMNS_IN_SELECT string Set to "Y" if columns in the ORDER BY clauses must be in the select list; otherwise set to "N".
SQL_OUTER_JOINS string The character string:
  • "Y" indicates that outer joins are supported, and DB2 CLI supports the ODBC outer join request syntax.
  • "N" indicates that it is not supported.

(See "Using Vendor Escape Clauses")

SQL_OWNER_TERM string This InfoType has been replaced with SQL_SCHEMA_TERM.

The database vendor's terminology for a schema (owner).

SQL_OWNER_USAGE 32-bit mask This InfoType has been replaced with SQL_SCHEMA_USAGE.

Indicates the type of SQL statements that have schema (owners) associated with them when these statements are executed, Schema qualifiers (owners) are:

  • SQL_OU_DML_STATEMENTS - supported in all DML statements.
  • SQL_OU_PROCEDURE_INVOCATION - supported in the procedure invocation statement.
  • SQL_OU_TABLE_DEFINITION - supported in all table definition statements.
  • SQL_OU_INDEX_DEFINITION - supported in all index definition statements.
  • SQL_OU_PRIVILEGE_DEFINITION - supported in all privilege definition statements (i.e. grant and revoke statements).
SQL_PARAM_ARRAY_ROW_COUNTS 32-bit unsigned integer Indicates the availability of row counts in a parameterized execution:
  • SQL_PARC_BATCH, individual row counts are available for each set of parameters. This is conceptually equivalent to the driver generating a batch of SQL statements, one for each parameter set in the array. Extended error information can be retrieved by using the SQL_PARAM_STATUS_PTR descriptor field.
  • SQL_PARC_NO_BATCH, there is only one row count available, which is the cumulative row count resulting from the execution of the statement for the entire array of parameters. This is conceptually equivalent to treating the statement along with the entire parameter array as one atomic unit. Errors are handled the same as if one statement were executed.
SQL_PARAM_ARRAY_SELECTS 32-bit unsigned integer Indicates the availability of result sets in a parameterized execution:
  • SQL_PAS_BATCH, there is one result set available per set of parameters. This is conceptually equivalent to the driver generating a batch of SQL statements, one for each parameter set in the array.
  • SQL_PAS_NO_BATCH, there is only one result set available, which represents the cumulative result set resulting from the execution of the statement for the entire array of parameters. This is conceptually equivalent to treating the statement along with the entire parameter array as one atomic unit.
  • SQL_PAS_NO_SELECT, a driver does not allow a result-set generating statement to be executed with an array of parameters.
SQL_POS_OPERATIONS 32-bit mask Reserved option, zero is returned for the bit-mask.
SQL_POSITIONED_STATEMENTS 32-bit mask Indicates the degree of support for Positioned UPDATE and Positioned DELETE statements:
  • SQL_PS_POSITIONED_DELETE
  • SQL_PS_POSITIONED_UPDATE
  • SQL_PS_SELECT_FOR_UPDATE, indicates whether or not the server requires the FOR UPDATE clause to be specified on a <query expression> in order for a column to be updateable via the cursor.
SQL_PROCEDURE_TERM string The name a database vendor uses for a procedure
SQL_PROCEDURES string A character string of "Y" indicates that the data source supports procedures and DB2 CLI supports the ODBC procedure invocation syntax specified in "Using Stored Procedures". "N" indicates that it does not.
SQL_QUALIFIER_LOCATION 16-bit integer This InfoType has been replaced with SQL_CATALOG_LOCATION.

A 16-bit integer value indicated the position of the qualifier in a qualified table name. DB2 CLI always returns SQL_QL_START for this information type.

SQL_QUALIFIER_NAME_SEPARATOR string The character(s) used as a separator between a catalog name and the qualified name element that follows it.

This InfoType has been replaced with SQL_CATALOG_NAME_SEPARATOR.

SQL_QUALIFIER_TERM string The database vendor's terminology for a qualifier

The name that the vendor uses for the high order part of a three part name.

Since DB2 CLI does not support three part names, a zero-length string is returned.

This InfoType has been replaced with SQL_CATALOG_TERM.

SQL_QUALIFIER_USAGE 32-bit mask This fInfoType has been replaced with SQL_CATALOG_USAGE.

This is similar to SQL_OWNER_USAGE except that this is used for catalog.

SQL_QUOTED_IDENTIFIER_CASE 16-bit integer Returns:
  • SQL_IC_UPPER - quoted identifiers in SQL are case insensitive and stored in upper case in the system catalog.
  • SQL_IC_LOWER - quoted identifiers in SQL are case insensitive and are stored in lower case in the system catalog.
  • SQL_IC_SENSITIVE - quoted identifiers (delimited identifiers) in SQL are case sensitive and are stored in mixed case in the system catalog.
  • SQL_IC_MIXED - quoted identifiers in SQL are case insensitive and are stored in mixed case in the system catalog.

This should be contrasted with the SQL_IDENTIFIER_CASE InfoType which is used to determine how (unquoted) identifiers are stored in the system catalog.

SQL_ROW_UPDATES string A character string of "Y" indicates changes are detected in rows between multiple fetches of the same rows, "N" indicates that changes are not detected.
SQL_SCROLL_CONCURRENCY 32-bit mask Indicates the concurrency options supported for the cursor.

The following bit-masks are used in conjunction with the flag to determine which options are supported:

  • SQL_SCCO_READ_ONLY
  • SQL_SCCO_LOCK
  • SQL_SCCO_TIMESTAMP
  • SQL_SCCO_VALUES

DB2 CLI returns SQL_SCCO_LOCK. indicating that the lowest level of locking that is sufficient to ensure the row can be updated is used.

SQL_SCROLL_OPTIONS 32-bit mask The scroll options supported for scrollable cursors.

The following bit-masks are used in conjunction with the flag to determine which options are supported:

  • SQL_SO_FORWARD_ONLY
  • SQL_SO_KEYSET_DRIVEN
  • SQL_SO_STATIC
  • SQL_SO_DYNAMIC
  • SQL_SO_MIXED

For more information about scrollable cursors see "Scrollable Cursors".

SQL_SEARCH_PATTERN_ESCAPE string Used to specify what the driver supports as an escape character for catalog functions such as (SQLTables(), SQLColumns())
SQL_SERVER_NAME string The Name of the DB2 Instance. In contrast to SQL_DATA_SOURCE_NAME, this is the actual name of the database server. (Some DBMSs provide a different name on CONNECT than the real server-name of the database.)
SQL_SPECIAL_CHARACTERS string Contains all the characters in addition to a...z, A...Z, 0...9, and _ that the server allows in non-delimited identifiers.
SQL_SQL_CONFORMANCE 32-bit unsigned integer Indicates the level of SQL-92 supported:
  • SQL_SC_SQL92_ENTRY, entry level SQL-92 compliant.
  • SQL_SC_FIPS127_2_TRANSITIONAL, FIPS 127-2 transitional level compliant.
  • SQL_SC_SQL92_FULL, full level SQL-92 compliant.
  • SQL_SC_ SQL92_INTERMEDIATE, intermediate level SQL-92 compliant.
SQL_SQL92_DATETIME_FUNCTIONS 32-bit mask Indicates the datetime scalar functions that are supported by DB2 CLI and the data source:
  • SQL_SDF_CURRENT_DATE
  • SQL_SDF_CURRENT_TIME
  • SQL_SDF_CURRENT_TIMESTAMP
SQL_SQL92_FOREIGN_KEY_DELETE_RULE 32-bit mask Indicates the rules supported for a foreign key in a DELETE statement, as defined by SQL-92:
  • SQL_SFKD_CASCADE
  • SQL_SFKD_NO_ACTION
  • SQL_SFKD_SET_DEFAULT
  • SQL_SFKD_SET_NULL
SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 32-bit mask Indicates the rules supported for a foreign key in an UPDATE statement, as defined by SQL-92:
  • SQL_SFKU_CASCADE
  • SQL_SFKU_NO_ACTION
  • SQL_SFKU_SET_DEFAULT
  • SQL_SFKU_SET_NULL
SQL_SQL92_GRANT 32-bit mask Indicates the clauses supported in a GRANT statement, as defined by SQL-92:
  • SQL_SG_DELETE_TABLE
  • SQL_SG_INSERT_COLUMN
  • SQL_SG_INSERT_TABLE
  • SQL_SG_REFERENCES_TABLE
  • SQL_SG_REFERENCES_COLUMN
  • SQL_SG_SELECT_TABLE
  • SQL_SG_UPDATE_COLUMN
  • SQL_SG_UPDATE_TABLE
  • SQL_SG_USAGE_ON_DOMAIN
  • SQL_SG_USAGE_ON_CHARACTER_SET
  • SQL_SG_USAGE_ON_COLLATION
  • SQL_SG_USAGE_ON_TRANSLATION
  • SQL_SG_WITH_GRANT_OPTION
SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 32-bit mask Indicates the numeric value scalar functions that are supported by DB2 CLI and the data source, as defined in SQL-92:
  • SQL_SNVF_BIT_LENGTH
  • SQL_SNVF_CHAR_LENGTH
  • SQL_SNVF_CHARACTER_LENGTH
  • SQL_SNVF_EXTRACT
  • SQL_SNVF_OCTET_LENGTH
  • SQL_SNVF_POSITION
SQL_SQL92_PREDICATES 32-bit mask Indicates the predicates supported in a SELECT statement, as defined by SQL-92.
  • SQL_SP_BETWEEN
  • SQL_SP_COMPARISON
  • SQL_SP_EXISTS
  • SQL_SP_IN
  • SQL_SP_ISNOTNULL
  • SQL_SP_ISNULL
  • SQL_SP_LIKE
  • SQL_SP_MATCH_FULL
  • SQL_SP_MATCH_PARTIAL
  • SQL_SP_MATCH_UNIQUE_FULL
  • SQL_SP_MATCH_UNIQUE_PARTIAL
  • SQL_SP_OVERLAPS
  • SQL_SP_QUANTIFIED_COMPARISON
  • SQL_SP_UNIQUE
SQL_SQL92_RELATIONAL_JOIN_OPERATORS 32-bit mask Indicates the relational join operators supported in a SELECT statement, as defined by SQL-92.
  • SQL_SRJO_CORRESPONDING_CLAUSE
  • SQL_SRJO_CROSS_JOIN
  • SQL_SRJO_EXCEPT_JOIN
  • SQL_SRJO_FULL_OUTER_JOIN
  • SQL_SRJO_INNER_JOIN (indicates support for the INNER JOIN syntax, not for the inner join capability)
  • SQL_SRJO_INTERSECT_JOIN
  • SQL_SRJO_LEFT_OUTER_JOIN
  • SQL_SRJO_NATURAL_JOIN
  • SQL_SRJO_RIGHT_OUTER_JOIN
  • SQL_SRJO_UNION_JOIN
SQL_SQL92_REVOKE 32-bit mask Indicates which clauses the data source supports in the REVOKE statement, as defined by SQL-92:
  • SQL_SR_CASCADE
  • SQL_SR_DELETE_TABLE
  • SQL_SR_GRANT_OPTION_FOR
  • SQL_SR_INSERT_COLUMN
  • SQL_SR_INSERT_TABLE
  • SQL_SR_REFERENCES_COLUMN
  • SQL_SR_REFERENCES_TABLE
  • SQL_SR_RESTRICT
  • SQL_SR_SELECT_TABLE
  • SQL_SR_UPDATE_COLUMN
  • SQL_SR_UPDATE_TABLE
  • SQL_SR_USAGE_ON_DOMAIN
  • SQL_SR_USAGE_ON_CHARACTER_SET
  • SQL_SR_USAGE_ON_COLLATION
  • SQL_SR_USAGE_ON_TRANSLATION
SQL_SQL92_ROW_VALUE_CONSTRUCTOR 32-bit mask Indicates the row value constructor expressions supported in a SELECT statement, as defined by SQL-92.
  • SQL_SRVC_VALUE_EXPRESSION
  • SQL_SRVC_NULL
  • SQL_SRVC_DEFAULT
  • SQL_SRVC_ROW_SUBQUERY
SQL_SQL92_STRING_FUNCTIONS 32-bit mask Indicates the string scalar functions that are supported by DB2 CLI and the data source, as defined by SQL-92:
  • SQL_SSF_CONVERT
  • SQL_SSF_LOWER
  • SQL_SSF_UPPER
  • SQL_SSF_SUBSTRING
  • SQL_SSF_TRANSLATE
  • SQL_SSF_TRIM_BOTH
  • SQL_SSF_TRIM_LEADING
  • SQL_SSF_TRIM_TRAILING
SQL_SQL92_VALUE_EXPRESSIONS 32-bit mask Indicates the value expressions supported, as defined by SQL-92.
  • SQL_SVE_CASE
  • SQL_SVE_CAST
  • SQL_SVE_COALESCE
  • SQL_SVE_NULLIF
SQL_SQL92_STANDARD_CLI_CONFORMANCE 32-bit mask Indicates the CLI standard or standards to which DB2 CLI conforms:
  • SQL_SCC_XOPEN_CLI_VERSION1
  • SQL_SCC_ISO92_CLI
SQL_STATIC_CURSOR_ATTRIBUTES1 32-bit mask Indicates the attributes of a static cursor that are supported by DB2 CLI (subset 1 of 2):
  • SQL_CA1_NEXT
  • SQL_CA1_ABSOLUTE
  • SQL_CA1_RELATIVE
  • SQL_CA1_BOOKMARK
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_UNLOCK
  • SQL_CA1_POS_POSITION
  • SQL_CA1_POS_UPDATE
  • SQL_CA1_POS_DELETE
  • SQL_CA1_POS_REFRESH
  • SQL_CA1_POSITIONED_UPDATE
  • SQL_CA1_POSITIONED_DELETE
  • SQL_CA1_SELECT_FOR_UPDATE
  • SQL_CA1_BULK_ADD
  • SQL_CA1_BULK_UPDATE_BY_BOOKMARK
  • SQL_CA1_BULK_DELETE_BY_BOOKMARK
  • SQL_CA1_BULK_FETCH_BY_BOOKMARK
SQL_STATIC_CURSOR_ATTRIBUTES2 32-bit mask Indicates the attributes of a static cursor that are supported by DB2 CLI (subset 2 of 2):
  • SQL_CA2_READ_ONLY_CONCURRENCY
  • SQL_CA2_LOCK_CONCURRENCY
  • SQL_CA2_OPT_ROWVER_CONCURRENCY
  • SQL_CA2_OPT_VALUES_CONCURRENCY
  • SQL_CA2_SENSITIVITY_ADDITIONS
  • SQL_CA2_SENSITIVITY_DELETIONS
  • SQL_CA2_SENSITIVITY_UPDATES
  • SQL_CA2_MAX_ROWS_SELECT
  • SQL_CA2_MAX_ROWS_INSERT
  • SQL_CA2_MAX_ROWS_DELETE
  • SQL_CA2_MAX_ROWS_UPDATE
  • SQL_CA2_MAX_ROWS_CATALOG
  • SQL_CA2_MAX_ROWS_AFFECTS_ALL
  • SQL_CA2_CRC_EXACT
  • SQL_CA2_CRC_APPROXIMATE
  • SQL_CA2_SIMULATE_NON_UNIQUE
  • SQL_CA2_SIMULATE_TRY_UNIQUE
  • SQL_CA2_SIMULATE_UNIQUE
SQL_STATIC_SENSITIVITY 32-bit mask Indicates whether changes made by an application with a positioned update or delete statement can be detected by that application:
  • SQL_SS_ADDITIONS: Added rows are visible to the cursor; the cursor can scroll to these rows. All DB2 servers see added rows.
  • SQL_SS_DELETIONS: Deleted rows are no longer available to the cursor and do not leave a hole in the result set; after the cursor scrolls from a deleted row, it cannot return to that row.
  • SQL_SS_UPDATES: Updates to rows are visible to the cursor; if the cursor scrolls from and returns to an updated row, the data returned by the cursor is the updated data, not the original data.
SQL_STRING_FUNCTIONS 32-bit mask Indicates which string functions are supported.

The following bit-masks are used to determine which string functions are supported:

  • SQL_FN_STR_ASCII
  • SQL_FN_STR_BIT_LENGTH
  • SQL_FN_STR_CHAR
  • SQL_FN_STR_CHAR_LENGTH
  • SQL_FN_STR_CHARACTER_LENGTH
  • SQL_FN_STR_CONCAT
  • SQL_FN_STR_DIFFERENCE
  • SQL_FN_STR_INSERT
  • SQL_FN_STR_LCASE
  • SQL_FN_STR_LEFT
  • SQL_FN_STR_LENGTH
  • SQL_FN_STR_LOCATE
  • SQL_FN_STR_LOCATE_2
  • SQL_FN_STR_LTRIM
  • SQL_FN_STR_OCTET_LENGTH
  • SQL_FN_STR_POSITION
  • SQL_FN_STR_REPEAT
  • SQL_FN_STR_REPLACE
  • SQL_FN_STR_RIGHT
  • SQL_FN_STR_RTRIM
  • SQL_FN_STR_SOUNDEX
  • SQL_FN_STR_SPACE
  • SQL_FN_STR_SUBSTRING
  • SQL_FN_STR_UCASE

If an application can call the LOCATE scalar function with the string_exp1, string_exp2, and start arguments, the SQL_FN_STR_LOCATE bitmask is returned. If an application can only call the LOCATE scalar function with the string_exp1 and string_exp2, the SQL_FN_STR_LOCATE_2 bitmask is returned. If the LOCATE scalar function is fully supported, both bitmasks are returned.

SQL_SUBQUERIES 32-bit mask Indicates which predicates support subqueries:
  • SQL_SQ_COMPARISION - the comparison predicate
  • SQL_SQ_CORRELATE_SUBQUERIES - all predicates
  • SQL_SQ_EXISTS - the exists predicate
  • SQL_SQ_IN - the in predicate
  • SQL_SQ_QUANTIFIED - the predicates containing a quantification scalar function.
SQL_SYSTEM_FUNCTIONS 32-bit mask Indicates which scalar system functions are supported.

The following bit-masks are used to determine which scalar system functions are supported:

  • SQL_FN_SYS_DBNAME
  • SQL_FN_SYS_IFNULL
  • SQL_FN_SYS_USERNAME
Note:These functions are intended to be used with the escape sequence in ODBC.
SQL_TABLE_TERM string The database vendor's terminology for a table
SQL_TIMEDATE_ADD_INTERVALS 32-bit mask Indicates whether or not the special ODBC system function TIMESTAMPADD is supported, and, if it is, which intervals are supported.

The following bitmasks are used to determine which intervals are supported:

  • SQL_FN_TSI_FRAC_SECOND
  • SQL_FN_TSI_SECOND
  • SQL_FN_TSI_MINUTE
  • SQL_FN_TSI_HOUR
  • SQL_FN_TSI_DAY
  • SQL_FN_TSI_WEEK
  • SQL_FN_TSI_MONTH
  • SQL_FN_TSI_QUARTER
  • SQL_FN_TSI_YEAR
SQL_TIMEDATE_DIFF_INTERVALS 32-bit mask Indicates whether or not the special ODBC system function TIMESTAMPDIFF is supported, and, if it is, which intervals are supported.

The following bitmasks are used to determine which intervals are supported:

  • SQL_FN_TSI_FRAC_SECOND
  • SQL_FN_TSI_SECOND
  • SQL_FN_TSI_MINUTE
  • SQL_FN_TSI_HOUR
  • SQL_FN_TSI_DAY
  • SQL_FN_TSI_WEEK
  • SQL_FN_TSI_MONTH
  • SQL_FN_TSI_QUARTER
  • SQL_FN_TSI_YEAR
SQL_TIMEDATE_FUNCTIONS 32-bit mask Indicates which time and date functions are supported.

The following bit-masks are used to determine which date functions are supported:

  • SQL_FN_TD_CURRENT_DATE
  • SQL_FN_TD_CURRENT_TIME
  • SQL_FN_TD_CURRENT_TIMESTAMP
  • SQL_FN_TD_CURDATE
  • SQL_FN_TD_CURTIME
  • SQL_FN_TD_DAYNAME
  • SQL_FN_TD_DAYOFMONTH
  • SQL_FN_TD_DAYOFWEEK
  • SQL_FN_TD_DAYOFYEAR
  • SQL_FN_TD_EXTRACT
  • SQL_FN_TD_HOUR
  • SQL_FN_TD_JULIAN_DAY
  • SQL_FN_TD_MINUTE
  • SQL_FN_TD_MONTH
  • SQL_FN_TD_MONTHNAME
  • SQL_FN_TD_NOW
  • SQL_FN_TD_QUARTER
  • SQL_FN_TD_SECOND
  • SQL_FN_TD_SECONDS_SINCE_MIDNIGHT
  • SQL_FN_TD_TIMESTAMPADD
  • SQL_FN_TD_TIMESTAMPDIFF
  • SQL_FN_TD_WEEK
  • SQL_FN_TD_YEAR
Note:These functions are intended to be used with the escape sequence in ODBC.
SQL_TXN_CAPABLE 16-bit integer Indicates whether transactions can contain DDL or DML or both.
  • SQL_TC_NONE = transactions not supported.
  • SQL_TC_DML = transactions can only contain DML statements (SELECT, INSERT, UPDATE, DELETE, etc.) DDL statements (CREATE TABLE, DROP INDEX, etc.) encountered in a transaction cause an error.
  • SQL_TC_DDL_COMMIT = transactions can only contain DML statements. DDL statements encountered in a transaction cause the transaction to be committed.
  • SQL_TC_DDL_IGNORE = transactions can only contain DML statements. DDL statements encountered in a transaction are ignored.
  • SQL_TC_ALL = transactions can contain DDL and DML statements in any order.
SQL_TXN_ISOLATION_OPTION 32-bit mask The transaction isolation levels available at the currently connected database server.

The following masks are used in conjunction with the flag to determine which options are supported:

  • SQL_TXN_READ_UNCOMMITTED
  • SQL_TXN_READ_COMMITTED
  • SQL_TXN_REPEATABLE_READ
  • SQL_TXN_SERIALIZABLE
  • SQL_TXN_NOCOMMIT
  • SQL_TXN_VERSIONING

For descriptions of each level refer to SQL_DEFAULT_TXN_ISOLATION.

SQL_UNION 32-bit mask Indicates if the server supports the UNION operator:
  • SQL_U_UNION - supports the UNION clause
  • SQL_U_UNION_ALL - supports the ALL keyword in the UNION clause

If SQL_U_UNION_ALL is set, so is SQL_U_UNION.

SQL_USER_NAME string The user name used in a particular database. This is the identifier specified on the SQLConnect() call.
SQL_XOPEN_CLI_YEAR string Indicates the year of publication of the X/Open specification with which the version of the driver fully complies.

Return Codes

Diagnostics

Table 106. SQLGetInfo SQLSTATEs
SQLSTATE Description Explanation
01004 Data truncated. The requested information was returned as a string and its length exceeded the length of the application buffer as specified in BufferLength. The argument StringLengthPtr contains the actual (not truncated) length of the requested information. (Function returns SQL_SUCCESS_WITH_INFO.)
08003 Connection is closed. The type of information requested in InfoType requires an open connection. Only SQL_ODBC_VER does not require an open connection.
40003 08S01 Communication link failure. The communication link between the application and data source failed before the function completed.
58004 Unexpected system failure. Unrecoverable system error.
HY001 Memory allocation failure. DB2 CLI is unable to allocate memory required to support execution or completion of the function.
HY009 Invalid argument value. The argument InfoValuePtr was a null pointer.

The InfoType was SQL_DRIVER_HSTMT and the value pointed to by InfoValuePtr was not a valid handle.

HY090 Invalid string or buffer length. The value specified for argument BufferLength was less than 0.
HY096 Information type out of range. An invalid InfoType was specified.
HYC00 Driver not capable. The value specified in the argument InfoType is not supported by either DB2 CLI or the data source.

Restrictions

None.

Example

/* From CLI sample getinfo.c */
/* ... */
*/
    /* Check to see if SQLGetInfo() is supported */
    rc = SQLGetFunctions(hdbc, SQL_API_SQLGETINFO, &supported);
 
    if (supported == SQL_TRUE) { /* get information about current connection */
 
        rc = SQLGetInfo(hdbc, SQL_DATA_SOURCE_NAME, buffer, 255, &outlen);
        printf("      Server Name: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_DATABASE_NAME,    buffer, 255, &outlen);
        printf("    Database Name: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_SERVER_NAME,      buffer, 255, &outlen);
        printf("    Instance Name: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_DBMS_NAME,        buffer, 255, &outlen);
        printf("        DBMS Name: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_DBMS_VER,         buffer, 255, &outlen);
        printf("     DBMS Version: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_DRIVER_NAME,      buffer, 255, &outlen);
        printf("   CLI Driver Name: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_DRIVER_VER,       buffer, 255, &outlen);
        printf("CLI Driver Version: %s\n", buffer);
 
        rc = SQLGetInfo(hdbc, SQL_ODBC_SQL_CONFORMANCE, &output,
                        sizeof(output), &outlen);
        switch (output) {
        case 0:
            strcpy((char *)buffer, "Minimum Grammar");
            break;
        case 1:
            strcpy((char *)buffer, "Core Grammar");
            break;
        case 2:
            strcpy((char *)buffer, "Extended Grammar");
            break;
        default:
            printf("Error calling getinfo!");
            return (SQL_ERROR);
        }
        printf("ODBC SQL Conformance Level: %s\n", buffer);
    }
    else printf( "SQLGetInfo is not supported!\n" ) ;

References


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]