SQLGetInfo() - Get general information

SQLGetInfo() returns general information about the database management systems to which the application is currently connected. For example, SQLGetInfo() indicates which data conversions are supported.

ODBC specifications for SQLGetInfo()

Table 1. SQLGetInfo() specifications
ODBC specification level In X/Open CLI CAE specification? In ISO CLI specification?
1.0 Yes Yes

Syntax

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

Function arguments

The following table lists the data type, use, and description for each argument in this function.

Table 2. SQLGetInfo() arguments
Data type Argument Use Description
SQLHDBC ConnectionHandle input Specifies a connection handle
SQLUSMALLINT InfoType input Specifies the type of information to request. This argument must be one of the values in the first column of Table 3.
SQLPOINTER InfoValuePtr output (and input) Points to a buffer where this function stores the retrieved information. Depending on the type of information that is retrieved, one of the following 5 types of information is returned:
  • 16-bit integer value
  • 32-bit integer value
  • 32-bit binary value
  • 32-bit mask
  • Nul-terminated character string
SQLSMALLINT BufferLength input Specifies the maximum length, in bytes, of the buffer to which the InfoValuePtr argument points.
SQLSMALLINT * StringLengthPtr output Points to the buffer where this function returns the number of bytes that are required to avoid truncation of the output information. In the case of string output, this size does not include the nul-terminator.

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

Usage

Table 3 lists the possible values for the InfoType argument and a description of the information that SQLGetInfo() returns for each value. This table indicates which InfoType argument values were renamed in ODBC 3.0.

Important: If the value that is specified for the InfoType argument does not apply or is not supported, the result is dependent on the return type. The following values are returned for each type of unsupported value in the InfoType argument:
  • 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).
The following table specifies each value that you can specify for the InfoType argument and describes the information that each of these values will return.
Table 3. Information returned by SQLGetInfo()
InfoType Format Description and notes
SQL_ACCESSIBLE_PROCEDURES string A character string of 'Y' indicates that the user can execute all procedures returned by the function SQLProcedures(). 'N' indicates that procedures can be 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 tables can be returned that the user cannot access.
SQL_ACTIVE_ENVIRONMENTS 16-bit integer The maximum number of active environments that the Db2 ODBC driver can support. If the limit is unspecified or unknown, this value is set to zero.
SQL_AGGREGATE_FUNCTIONS 32-bit mask A bit mask 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 ODBC returns 0 indicating that the ALTER DOMAIN statement is not supported. ODBC also defines the following values that Db2 ODBC does not return:
  • 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_ALTER_TABLE 32-bit mask Indicates which clauses in ALTER TABLE are supported by the database management system.
  • SQL_AT_ADD_COLUMN
  • SQL_AT_DROP_COLUMN
SQL_ASCII_GCCSID 32-bit integer Specifies the ASCII GCCSID value currently set in the AGCCSID field of Db2 DSNHDECP.
SQL_ASCII_MCCSID 32-bit integer Specifies the ASCII MCCSID value currently set in the AMCCSID field of Db2 DSNHDECP.
SQL_ASCII_SCCSID 32-bit integer Specifies the ASCII SCCSID value currently set in the ASCCSID field of Db2 DSNHDECP.
SQL_BATCH_ROW_COUNT 32-bit mask Indicates the availability of row counts. Db2 ODBC 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 Db2 ODBC does not return:
  • 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 Reserved attribute, zero is returned for the bit-mask.
SQL_CATALOG_LOCATION

(In previous versions of Db2 ODBC, this InfoType is SQL_QUALIFIER_LOCATION.)

16-bit integer A 16-bit integer value indicated the position of the qualifier in a qualified table name. Zero indicates that qualified names are not supported.
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

(In previous versions of Db2 ODBC, this InfoType is SQL_QUALIFIER_NAME_SEPARATOR.)

string The characters used as a separator between a catalog name and the qualified name element that follows it.
SQL_CATALOG_TERM

(In previous versions of Db2 ODBC, this InfoType is 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.

Because Db2 ODBC does not support three part names, a zero-length string is returned.

For non-ODBC applications, the SQL_CATALOG_TERM symbolic name should be used instead of SQL_QUALIFIER_NAME.

SQL_CATALOG_USAGE (In previous versions of Db2 ODBC, this InfoType is SQL_QUALIFIER_USAGE.) 32-bit mask This is similar to SQL_OWNER_USAGE except that this is used for catalog.
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, EBCDIC). If this is unknown, an empty string is 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® relational database management systems).
  • 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_DAY_TIME
SQL_CONVERT_INTERVAL_YEAR_MONTH
SQL_CONVERT_LONGVARBINARY
SQL_CONVERT_LONGVARCHAR
SQL_CONVERT_NUMERIC
SQL_CONVERT_REAL
SQL_CONVERT_ROWID
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 bit mask 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 bit mask with SQL_CVT_DECIMAL. If the resulting value is nonzero then the conversion is supported.

The following bit masks 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_LONGVARBINARY
  • SQL_CVT_LONGVARCHAR
  • SQL_CVT_NUMERIC
  • SQL_CVT_REAL
  • SQL_CVT_ROWID
  • 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.
  • SQL_FN_CVT_CONVERT - used to determine which conversion functions are supported.
  • SQL_FN_CVT_CAST - used to determine which cast 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 represents.
SQL_CLOSE_BEHAVIOR 32-bit integer Indicates whether 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 fOption set to SQL_CLOSE or the statement handle is freed with SQLFreeHandle(). In addition, the end of the transaction (when a commit or rollback is issued) can also cause the closing of the cursor (depending on the WITH HOLD attribute currently in use).
SQL_CREATE_ASSERTION 32-bit mask Indicates which clauses in the CREATE ASSERTION statement are supported by the database management system. Db2 ODBC always returns zero; the CREATE ASSERTION statement is not supported. ODBC also defines the following values that Db2 ODBC does not return:
  • 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 database management system. Db2 ODBC always returns zero; the CREATE CHARACTER SET statement is not supported. ODBC also defines the following values that Db2 ODBC does not return:
  • 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 COLLATION statement are supported by the database management system. Db2 ODBC always returns zero; the CREATE COLLATION statement is not supported. ODBC also defines the following values that Db2 ODBC does not return:
  • SQL_CCOL_CREATE_COLLATION
SQL_CREATE_DOMAIN 32-bit mask Indicates which clauses in the CREATE DOMAIN statement are supported by the database management system. Db2 ODBC always returns zero; the CREATE DOMAIN statement is not supported. ODBC also defines the following values that Db2 ODBC does not return:
  • 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 database management system:
  • 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 database management system. The following bit masks 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 database management system. Db2 ODBC always returns zero; the CREATE TRANSLATION statement is not supported. ODBC also defines the following value that Db2 ODBC does not return:
  • SQL_CTR_CREATE_TRANSLATION
SQL_CURSOR_COMMIT_BEHAVIOR 16-bit integer Indicates how a COMMIT operation affects cursors. A value of:
  • SQL_CB_DELETE, destroys cursors and drops access plans for dynamic SQL statements.
  • SQL_CB_CLOSE, destroys 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.

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, destroys cursors and drops access plans for dynamic SQL statements.
  • SQL_CB_CLOSE, destroys 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.

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 the result set by any other cursor within the same transaction.

  • SQL_UNSPECIFIED

    It 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; an "N" indicates that it is not set to READ ONLY mode.
SQL_DATABASE_NAME string The name of the current database in use. Also, this information returned by SELECT CURRENT SERVER on IBM database management systems.
SQL_DBMS_NAME string The name of the database management system product being accessed.
SQL_DBMS_VER string The version of the database management system product being 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, "02.01.0000" translates to major version 2, 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 the IBM 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 the IBM 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 the IBM 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 the IBM RR level.

  • SQL_TXN_VERSIONING = Not applicable to IBM database management systems.
  • SQL_TXN_NOCOMMIT = Any changes are effectively committed at the end of a successful operation; no explicit commit or rollback is allowed.

    This is a Db2 for i 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_DRIVER_HDBC 32 bits Db2 ODBC's current database handle.
SQL_DRIVER_HENV 32 bits Db2 ODBC's environment handle.
SQL_DRIVER_HLIB 32 bits Reserved.
SQL_DRIVER_HSTMT 32 bits Db2 ODBC's current statement handle for the current connection.
SQL_DRIVER_NAME string The file name of the Db2 ODBC implementation. Db2 ODBC returns NULL.
SQL_DRIVER_ODBC_VER string The version number of ODBC that the driver supports. Db2 ODBC returns "3.00".
SQL_DRIVER_VER string The version of the CLI driver. A string of the form 'mm.vv.rrrr'
mm
The major version.
vv
The minor version.
rrrr
The release.
For example, '08.01.0000' means, major version 3, minor version 1, release 0.
SQL_DROP_ASSERTION 32-bit mask Indicates which clause in the DROP ASSERTION statement is supported by the database management system. Db2 ODBC always returns zero; the DROP ASSERTION statement is not supported. ODBC also defines the following value that Db2 ODBC does not return:
  • SQL_DA_DROP_ASSERTION
SQL_DROP_CHARACTER_SET 32-bit mask Indicates which clause in the DROP CHARACTER SET statement is supported by the database management system. Db2 ODBC always returns zero; the DROP CHARACTER SET statement is not supported. ODBC also defines the following value that Db2 ODBC does not return.
  • SQL_DCS_DROP_CHARACTER_SET
SQL_DROP_COLLATION 32-bit mask Indicates which clause in the DROP COLLATION statement is supported by the database management system. Db2 ODBC always returns zero; the DROP COLLATION statement is not supported. ODBC also defines the following value that Db2 ODBC does not return:
  • SQL_DC_DROP_COLLATION
SQL_DROP_DOMAIN 32-bit mask Indicates which clauses in the DROP DOMAIN statement are supported by the database management system. Db2 ODBC always returns zero; the DROP DOMAIN statement is not supported. ODBC also defines the following values that Db2 ODBC does not return:
  • SQL_DD_DROP_DOMAIN
  • SQL_DD_CASCADE
  • SQL_DD_RESTRICT
SQL_DROP_SCHEMA 32-bit mask Indicates which clauses in the DROP SCHEMA statement are supported by the database management system.
  • SQL_DS_DROP_SCHEMA
  • SQL_DS_CASCADE
  • SQL_DS_RESTRICT
SQL_DROP_TABLE 32-bit mask Indicates which clauses in the DROP TABLE statement are supported by the database management system:
  • SQL_DT_DROP_TABLE
  • SQL_DT_CASCADE
  • SQL_DT_RESTRICT
SQL_DROP_TRANSLATION 32-bit mask Indicates which clauses in the DROP TRANSLATION statement are supported by the database management system. Db2 ODBC always returns zero; the DROP TRANSLATION statement is not supported. ODBC also defines the following value that Db2 ODBC does not return:
  • SQL_DTR_DROP_TRANSLATION
SQL_DROP_VIEW 32-bit mask Indicates which clauses in the DROP VIEW statement are supported by the database management system.
  • SQL_DV_DROP_VIEW
  • SQL_DV_CASCADE
  • SQL_DV_RESTRICT
SQL_DYNAMIC_CURSOR_ATTRIBUTES1 32-bit mask Indicates the attributes of a dynamic cursor that Db2 ODBC supports (subset 1 of 2).
  • SQL_CA1_NEXT
  • SQL_CA1_ABSOLUTE
  • SQL_CA1_RELATIVE
  • SQL_CA1_BOOKMARK
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_NOLOCK
  • 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 that Db2 ODBC supports (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_EBCDIC_GCCSID 32-bit integer Specifies the EBCDIC GCCSID value currently set in the AGCCSID field of Db2 DSNHDECP.
SQL_EBCDIC_MCCSID 32-bit integer Specifies the EBCDIC MCCSID value currently set in the AMCCSID field of Db2 DSNHDECP.
SQL_EBCDIC_SCCSID 32-bit integer Specifies the EBCDIC SCCSID value currently set in the ASCCSID field of Db2 DSNHDECP.
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 attribute values 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 Reserved. Zero is returned.
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 32-bit mask Indicates the attributes of a forward-only cursor that Db2 ODBC supports (subset 1 of 2).
  • SQL_CA1_NEXT
  • SQL_CA1_POSITIONED_UPDATE
  • SQL_CA1_POSITIONED_DELETE
  • SQL_CA1_SELECT_FOR_UPDATE
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_NOLOCK
  • 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 attributes of a forward-only cursor that Db2 ODBC supports (subset 2 of 2).
  • SQL_CA2_READ_ONLY_CONCURRENCY
  • SQL_CA2_LOCK_CONCURRENCY
  • SQL_CA2_MAX_ROWS_SELECT
  • SQL_CA2_MAX_ROWS_CATALOG
  • 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 ODBC:
  • 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.

ODBC also defines the following extensions, which are not returned by Db2 ODBC:
  • SQL_GD_BLOCK
  • SQL_GD_BOUND
SQL_GROUP_BY 16-bit integer Indicates the degree of support for the GROUP BY clause by the server:
  • SQL_GB_NO_RELATION, the columns in the GROUP BY and in the SELECT list are not related
  • 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_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.

IBM specific: Identifier names in IBM database management systems are not case sensitive.

SQL_IDENTIFIER_QUOTE_CHAR string Indicates the character used to surround a delimited identifier.
SQL_INFO_SCHEMA_VIEWS 32-bit mask Indicates the views in the INFORMATIONAL_SCHEMA that are supported. Db2 ODBC always returns zero; no views in the INFORMATIONAL_SCHEMA are supported. ODBC also defines the following values that Db2 ODBC does not return:
  • 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 (In previous versions of Db2 ODBC, this InfoType is SQL_ODBC_SQL_OPT_IEF.) string A 'Y' indicates that the data source supports Integrity Enhanced Facility (IEF) in SQL89 and in X/Open XPG4 Embedded SQL; an 'N' indicates that it does not.
SQL_KEYSET_CURSOR_ATTRIBUTES1 32-bit mask Indicates the attributes of a keyset cursor that Db2 ODBC supports (subset 1 of 2).
  • SQL_CA1_NEXT
  • SQL_CA1_ABSOLUTE
  • SQL_CA1_RELATIVE
  • SQL_CA1_BOOKMARK
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_NOLOCK
  • 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 attributes of a keyset cursor that Db2 ODBC supports (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_KEYWORDS string A string of all the keywords at the database management system 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 attribute, 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 ODBC can support on a given connection. This value is zero if this number has no specific limit, or the limit is unknown.
SQL_MAX_BINARY_LITERAL_LEN 32-bit integer A 32-bit integer value specifying the maximum length of a hexadecimal literal in a SQL statement.
SQL_MAX_CATALOG_NAME_LEN (In previous versions of Db2 ODBC, this InfoType is SQL_MAX_QUALIFIER_NAME_LEN.) 16-bit integer The maximum length of a catalog qualifier name; first part of a three-part table name (in bytes).
SQL_MAX_CHAR_LITERAL_LEN 32-bit 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 (In previous versions of Db2 ODBC, this InfoType is SQL_ACTIVE_STATEMENTS.) 16-bit integer The maximum number of active statements per connection.

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

SQL_MAX_CURSOR_NAME_LEN 16-bit integer The maximum length of a cursor name (in bytes).
SQL_MAX_DRIVER_CONNECTIONS (In previous versions of Db2 ODBC, this InfoType is SQL_ACTIVE_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 initialization file or the SQL_MAX_CONNECTIONS environment and connection attribute 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_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 integer Indicates the maximum size in bytes that the server supports for the combined columns in an index. Zero if no limit.
SQL_MAX_PROCEDURE_NAME_LEN 16-bit integer The maximum length of a procedure name (in bytes).
SQL_MAX_ROW_SIZE 32-bit 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 Returns 'Y' if SQLGetInfo() with InfoType set to SQL_MAX_ROW_SIZE includes the length of product-specific long string data types. Otherwise, returns 'N'.
SQL_MAX_SCHEMA_NAME_LEN (In previous versions of Db2 ODBC, this InfoType is SQL_MAX_OWNER_NAME_LEN.)

16-bit integer The maximum length of a schema qualifier name (in bytes).
SQL_MAX_STATEMENT_LEN 32-bit integer Indicates the maximum length, in bytes, of an SQL statement string, which includes 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.
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 null values 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.
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_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 - means that the current database management system supports minimum ODBC SQL grammar. Minimum SQL grammar must include the following elements:
    • CREATE TABLE and DROP TABLE data definitions
    • Simple SELECT, INSERT, UPDATE, and DELETE data manipulation
    • Simple expressions
    • CHAR, VARCHAR, and LONG VARCHAR data types
  • SQL_OSC_CORE - means that the current database management system supports ODBC SQL core grammar. Core ODBC SQL grammar must include the following elements:
    • Minimum ODBC SQL grammar
    • ALTER TABLE, CREATE INDEX, DROP INDEX, CREATE VIEW, DROP VIEW, GRANT, and REVOKE data definitions
    • Full SELECT data manipulation
    • Subquery and function expressions
    • DECIMAL, NUMERIC, SMALLINT, INTEGER, REAL, FLOAT, DOUBLE PRECISION data types
  • SQL_OSC_EXTENDED - means the current database management system supports extended ODBC SQL grammar. Extended ODBC SQL grammar must include the following elements:
    • Core ODBC SQL grammar
    • Positioned UPDATE, positioned DELETE, SELECT FOR UPDATE, and UNION data definitions
    • Scalar functions, literal date, literal time, and literal timestamp expressions
    • BIT, TINYINT, BIGINT, BINARY, VARBINARY, LONG VARBINARY, DATE, TIME, TIMESTAMP, and XML data types
    • Batch SQL statements
    • Procedure calls
SQL_ODBC_VER string The version number of ODBC that the driver manager supports.

Db2 ODBC returns the string "03.01.0000".

SQL_OJ_CAPABILITIES 32-bit mask A 32-bit bit mask enumerating the types of outer join supported.
The bit masks 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_NOT_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_OPS: Any predicate can 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 ODBC supports the ODBC outer join request syntax.
  • 'N' indicates that it is not supported.
SQL_OWNER_TERM (In previous versions of Db2 ODBC, this InfoType is SQL_SCHEMA_TERM.) string The database vendor's (owner's) terminology for a schema
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: Only one row count is 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: One result set is 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: Only one result set is 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 attribute, 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 the server requires the FOR UPDATE clause to be specified on a <query expression> in order for a column to be updatable using the cursor.
SQL_PROCEDURE_TERM string The name a database vendor uses for a procedure
SQL_PROCEDURES string 'Y' indicates that the data source supports procedures and Db2 ODBC supports the ODBC procedure invocation syntax. 'N' indicates that it does not.
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_SCHEMA_USAGE (In previous versions of Db2 ODBC, this InfoType is SQL_OWNER_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_OU_DML_STATEMENTS - supported in all Data Manipulation Language 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 (for example, grant and revoke statements).
SQL_SCROLL_CONCURRENCY 32-bit mask Indicates the concurrency options that are supported for the cursor.
The following bit-masks are used in conjunction with the flag to determine which attribute values are supported:
  • SQL_SCCO_READ_ONLY
  • SQL_SCCO_LOCK
  • SQL_SCCO_OPT_TIMESTAMP
  • SQL_SCCO_OPT_VALUES

Db2 ODBC returns SQL_SCCO_LOCK, indicating that the level of locking that is used is 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 that are supported for scrollable cursors.
The following bit masks are used in conjunction with the flag to determine which attribute values are supported:
  • SQL_SO_FORWARD_ONLY
  • SQL_SO_KEYSET_DRIVEN
  • SQL_SO_STATIC
  • SQL_SO_DYNAMIC
  • SQL_SO_MIXED
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 subsystem to which the application is connected.
SQL_SPECIAL_CHARACTERS string Contains all the characters that the server allows in non-delimited identifiers. This includes a...z, A...Z, 0...9, and _.
SQL_SQL92_PREDICATES 32-bit mask Indicates those predicates that are defined by ANSI/ISO SQL standard of 1992 and that are supported in a SELECT statement.
  • 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_VALUE_EXPRESSIONS 32-bit mask Indicates those value expressions that are defined by SQL92 and that are supported.
  • SQL_SVE_CASE
  • SQL_SVE_CAST
  • SQL_SVE_COALESCE
  • SQL_SVE_NULLIF
SQL_STATIC_CURSOR_ATTRIBUTES1 32-bit mask Indicates the attributes of a static cursor that Db2 ODBC supports (subset 1 of 2).
  • SQL_CA1_NEXT
  • SQL_CA1_ABSOLUTE
  • SQL_CA1_RELATIVE
  • SQL_CA1_BOOKMARK
  • SQL_CA1_LOCK_EXCLUSIVE
  • SQL_CA1_LOCK_NO_CHANGE
  • SQL_CA1_LOCK_NOLOCK
  • 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 Db2 ODBC supports (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_CHAR
  • 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_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 string1, string2, and start arguments, the SQL_FN_STR_LOCATE bit mask is returned. If an application can only call the LOCATE scalar function with the string1 and string2, the SQL_FN_STR_LOCATE_2 bit mask is returned. If the LOCATE scalar function is fully supported, both bit masks are returned.

SQL_SUBQUERIES 32-bit mask Indicates which predicates support subqueries:
  • SQL_SQ_COMPARISON - 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

Tip: 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 the special ODBC system function TIMESTAMPADD is supported, and, if it is, which intervals are supported.
The following bit masks 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 the special ODBC system function TIMESTAMPDIFF is supported, and, if it is, which intervals are supported.
The following bit masks 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_CURDATE
  • SQL_FN_TD_CURTIME
  • SQL_FN_TD_DAYNAME
  • SQL_FN_TD_DAYOFMONTH
  • SQL_FN_TD_DAYOFWEEK
  • SQL_FN_TD_DAYOFYEAR
  • 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

Tip: These functions are intended to be used with the escape sequence in ODBC.

SQL_TXN_CAPABLE 16-bit integer Indicates whether transactions can contain Data Definition Language, or Data Manipulation Language, or both.
  • SQL_TC_NONE - transactions not supported.
  • SQL_TC_DML - transactions can only contain Data Manipulation Language statements (SELECT, INSERT, UPDATE, DELETE, and so on) Data Definition Language statements (CREATE TABLE, DROP INDEX, and so on) encountered in a transaction cause an error.
  • SQL_TC_DDL_COMMIT - transactions can only contain Data Manipulation Language statements. Data Definition Language statements encountered in a transaction cause the transaction to be committed.
  • SQL_TC_DDL_IGNORE - transactions can only contain Data Manipulation Language statements. Data Definition Language statements encountered in a transaction are ignored.
  • SQL_TC_ALL - transactions can contain Data Definition Language and Data Manipulation Language statements in any order.
SQL_TXN_ISOLATION_OPTION 32-bit mask The transaction isolation levels available at the currently connected database server.
The following bit masks are used in conjunction with the flag to determine which attribute values 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, see SQL_DEFAULT_TXN_ISOLATION.
SQL_UNICODE_GCCSID 32-bit integer Specifies the UNICODE GCCSID value currently set in the UGCCSID field of Db2 DSNHDECP.
SQL_UNICODE_MCCSID 32-bit integer Specifies the UNICODE MCCSID value currently set in the UMCCSID field of Db2 DSNHDECP.
SQL_UNICODE_SCCSID 32-bit integer Specifies the UNICODE SCCSID value currently set in the USCCSID field of Db2 DSNHDECP.
SQL_UNION 32-bit mask Indicates whether 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, SQL_U_UNION is set as well.
SQL_USER_NAME string The user name that is 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

After you call SQLGetInfo(), it returns one of the following values:
  • SQL_SUCCESS
  • SQL_SUCCESS_WITH_INFO
  • SQL_ERROR
  • SQL_INVALID_HANDLE

Diagnostics

The following table lists each SQLSTATE that this function generates, with a description and explanation for each value.

Table 4. SQLGetInfo() SQLSTATEs
SQLSTATE Description Explanation
01004 Data truncated. The requested information is returned as a string and its length exceeds the length of the application buffer as specified in the BufferLength argument. The StringLengthPtr argument contains the actual (not truncated) length, in bytes, of the requested information. (SQLGetInfo() returns SQL_SUCCESS_WITH_INFO for this SQLSTATE.)
08003 Connection is closed. The type of information that the InfoType argument requests requires an open connection. Only the value SQL_ODBC_VER does not require an open connection.
08S01 Communication link failure. The communication link between the application and data source fails before the function completes.
58004 Unexpected system failure. Unrecoverable system error.
HY001 Memory allocation failure. Db2 ODBC is not able to allocate the required memory to support the execution or the completion of the function.
HY090 Invalid string or buffer length. The value specified for the argument BufferLength is less than 0.
HY096 Invalid information type. An invalid value is specified for the InfoType argument.
HYC00 Driver not capable. The value specified in the argument InfoType is not supported by Db2 ODBC or is not supported by the data source.

Example

The following lines of code use SQLGetInfo() to retrieve the current data source name:
SQLCHAR         buffer[255];
SQLSMALLINT     outlen;
rc = SQLGetInfo(hdbc, SQL_DATA_SOURCE_NAME, buffer, 255, &outlen);
printf("\nServer Name: %s\n", buffer);