Depr in the ODBC column indicates that the function has been deprecated in ODBC. See DB2 CLI Functions Deprecated for Version 5 for more information.
The SQL/CLI column can have the following values:
Table 12. DB2 CLI Function List by Category
Task Function Name | ODBC 3.0 | SQL/CLI |
DB2 CLI First Version Supported | Purpose | ||
---|---|---|---|---|---|---|
Connecting to a Data Source | ||||||
SQLAllocEnv | Depr | 95 | V 1.1 | Obtains an environment handle. One environment handle is used for one or more connections. | ||
SQLAllocConnect | Depr | 95 | V 1.1 | Obtains a connection handle. | ||
SQLAllocHandle() | Core | 95 | V 5 | Obtains a handle. | ||
SQLBrowseConnect() | Level 1 | 95 | V 5 | Get required attributes to connect to a data source. | ||
SQLConnect() | Core | 95 | V 1.1 | Connects to specific driver by data source name, user Id, and password. | ||
SQLDriverConnect() | Core | SQL3 | V 2.1 a | Connects to a specific driver by connection string or optionally requests
that the Driver Manager and driver display connection dialogs for the
user.
| ||
SQLDrivers() | Core | No | NONE | DB2 CLI does not support this function as it is implemented by a Driver Manager. | ||
SQLSetConnectAttr() | Core | 95 | V 5 | Set connection attributes. | ||
SQLSetConnectOption() | Depr | 95 | V 2.1 | Set connection attributes. | ||
SQLSetConnection() | No | SQL3 | V 2.1 | Sets the current active connection. This function only needs to be used when using embedded SQL within a DB2 CLI application with multiple concurrent connections. | ||
DataLink Functions | ||||||
SQLBuildDataLink() | No | Yes | V 5.2 | Build DATALINK Value | ||
SQLGetDataLinkAttr() | No | Yes | V 5.2 | Get DataLink attribute value | ||
Obtaining Information about a Driver and Data Source | ||||||
SQLDataSources | Lvl 2 | 95 | V 1.1 | Returns the list of available data sources. | ||
SQLGetInfo() | Core | 95 | V 1.1 | Returns information about a specific driver and data source. | ||
SQLGetFunctions() | Core | 95 | V 1.1 | Returns supported driver functions. | ||
SQLGetTypeInfo() | Core | 95 | V 1.1 | Returns information about supported data types. | ||
Setting and Retrieving Driver Options | ||||||
SQLSetEnvAttr() | Core | 95 | V 2.1 | Sets an environment option. | ||
SQLGetEnvAttr() | Core | 95 | V 2.1 | Returns the value of an environment option. | ||
SQLSetConnectOption() | Lvl 1 | Yes | V 2.1 a | Sets a connection option. | ||
SQLGetConnectAttr() | Lvl 1 | 95 | V 5 | Returns the value of a connection option. | ||
SQLGetConnectOption() | Depr | 95 | V 2.1 a | Returns the value of a connection option. | ||
SQLSetStmtAttr() | Core | 95 | V 5 | Sets a statement attribute. | ||
SQLSetStmtOption() | Depr | 95 | V 2.1 a | Sets a statement option. | ||
SQLGetStmtAttr() | Core | 95 | V 5 | Returns the value of a statement attribute. | ||
SQLGetStmtOption() | Depr | 95 | V 2.1 a | Returns the value of a statement option. | ||
Preparing SQL Requests | ||||||
SQLAllocStmt() | Depr | 95 | V 1.1 | Allocates a statement handle. | ||
SQLPrepare() | Core | 95 | V 1.1 | Prepares an SQL statement for later execution. | ||
SQLExtendedPrepare() | No | No | V 6 | Prepares an array of statement attributes for an SQL statement for later execution. | ||
SQLExtendedBind() | No | No | V 6 | Bind an array of columns instead of using repeated calls to SQLBindCol() and SQLBindParameter() | ||
SQLBindParameter() | Lvl 1 | 95 b | V 2.1 | Assigns storage for a parameter in an SQL statement (ODBC 2.0) | ||
SQLSetParam() | Depr | No | V 1.1 | Assigns storage for a parameter in an SQL statement (ODBC
1.0).
| ||
SQLParamOptions() | Depr | No | V 2.1 | Specifies the use of multiple values for parameters. | ||
SQLGetCursorName() | Core | 95 | V 1.1 | Returns the cursor name associated with a statement handle. | ||
SQLSetCursorName() | Core | 95 | V 1.1 | Specifies a cursor name. | ||
Submitting Requests | ||||||
SQLDescribeParam() | Level 2 | SQL3 | V 5 | Returns description of a parameter marker. | ||
SQLExecute() | Core | 95 | V 1.1 | Executes a prepared statement. | ||
SQLExecDirect() | Core | 95 | V 1.1 | Executes a statement. | ||
SQLNativeSql() | Lvl 2 | 95 | V 2.1 a | Returns the text of an SQL statement as translated by the driver. | ||
SQLNumParams() | Lvl 2 | 95 | V 2.1 a | Returns the number of parameters in a statement. | ||
SQLParamData() | Lvl 1 | 95 | V 2.1 a | Used in conjunction with SQLPutData() to supply parameter data at execution time. (Useful for long data values.) | ||
SQLPutData() | Core | 95 | V 2.1 a | Send part or all of a data value for a parameter. (Useful for long data values.) | ||
Retrieving Results and Information about Results | ||||||
SQLRowCount() | Core | 95 | V 1.1 | Returns the number of rows affected by an insert, update, or delete request. | ||
SQLNumResultCols() | Core | 95 | V 1.1 | Returns the number of columns in the result set. | ||
SQLDescribeCol() | Core | 95 | V 1.1 | Describes a column in the result set. | ||
SQLColAttribute() | Core | Yes | V 5 | Describes attributes of a column in the result set. | ||
SQLColAttributes() | Depr | Yes | V 1.1 | Describes attributes of a column in the result set. | ||
SQLColumnPrivileges() | Level 2 | 95 | V 2.1 | Get privileges associated with the columns of a table. | ||
SQLSetColAttributes() | No | No | V 2.1 | Sets attributes of a column in the result set. | ||
SQLBindCol() | Core | 95 | V 1.1 | Assigns storage for a result column and specifies the data type. | ||
SQLFetch() | Core | 95 | V 1.1 | Returns a result row. | ||
SQLFetchScroll() | Core | 95 | V 5 | Returns a rowset from a result row. | ||
SQLExtendedFetch() | Depr | 95 | V 2.1 | Returns multiple result rows. | ||
SQLGetData() | Core | 95 | V 1.1 | Returns part or all of one column of one row of a result set. (Useful for long data values.) | ||
SQLMoreResults() | Lvl 1 | SQL3 | V 2.1 a | Determines whether there are more result sets available and, if so, initializes processing for the next result set. | ||
SQLError() | Depr | 95 | V 1.1 | Returns additional error or status information. | ||
SQLGetDiagField() | Core | 95 | V 5 | Get a field of diagnostic data. | ||
SQLGetDiagRec() | Core | 95 | V 5 | Get multiple fields of diagnostic data. | ||
SQLSetPos() | Level 1 | SQL3 | V 5 | Set the cursor position in a rowset. | ||
SQLGetSQLCA() | No | No | V 2.1 | Returns the SQLCA associated with a statement handle. | ||
SQLBulkOperations() | Level 1 | No | V 6 | Perform bulk insertions, updates, deletions, and fetches by bookmark. | ||
Descriptors | ||||||
SQLCopyDesc() | Core | 95 | V 5 | Copy descriptor information between handles. | ||
SQLGetDescField() | Core | 95 | V 5 | Get single field settings of a descriptor record. | ||
SQLGetDescRec() | Core | 95 | V 5 | Get multiple field settings of a descriptor record. | ||
SQLSetDescField() | Core | 95 | V 5 | Set a single field of a descriptor record. | ||
SQLSetDescRec() | Core | 95 | V 5 | Set multiple field settings of a descriptor record. | ||
Large Object Support | ||||||
SQLBindFileToCol() | No | No | V 2.1 | Associates LOB file reference with a LOB column. | ||
SQLBindFileToParam() | No | No | V 2.1 | Associates LOB file reference with a parameter marker. | ||
SQLGetLength() | No | SQL3 | V 2.1 | Gets length of a string referenced by a LOB locator. | ||
SQLGetPosition() | No | SQL3 | V 2.1 | Gets the position of a string within a source string referenced by a LOB locator. | ||
SQLGetSubString() | No | SQL3 | V 2.1 | Creates a new LOB locator that references a substring within a source string (the source string is also represented by a LOB locator). | ||
Obtaining information about the data source's system tables (catalog functions) | ||||||
SQLColumns() | Lvl 1 | SQL3 | V 2.1 a | Returns the list of column names in specified tables. | ||
SQLForeignKeys() | Lvl 2 | SQL3 | V 2.1 | Returns a list of column names that comprise foreign keys, if they exist for a specified table. | ||
SQLPrimaryKeys() | Lvl 1 | SQL3 | V 2.1 | Returns the list of column name(s) that comprise the primary key for a table. | ||
SQLProcedureColumns() | Lvl 2 | No | V 2.1 | Returns the list of input and output parameters for the specified procedures. | ||
SQLProcedures() | Lvl 2 | No | V 2.1 | Returns the list of procedure names stored in a specific data source. | ||
SQLSpecialColumns() | Core | SQL3 | V 2.1 a | Returns information about the optimal set of columns that uniquely identifies a row in a specified table. | ||
SQLStatistics() | Core | SQL3 | V 2.1 a | Returns statistics about a single table and the list of indexes associated with the table. | ||
SQLTablePrivileges() | Lvl 2 | SQL3 | V 2.1 | Returns a list of tables and the privileges associated with each table. | ||
SQLTables() | Core | SQL3 | V 2.1 a | Returns the list of table names stored in a specific data source. | ||
Terminating a Statement | ||||||
SQLFreeHandle() | Core | 95 | V 1.1 | Free Handle Resources. | ||
SQLFreeStmt() | Core | 95 | V 1.1 | End statement processing and closes the associated cursor, discards pending results, and, optionally, frees all resources associated with the statement handle. | ||
SQLCancel() | Core | 95 | V 1.1 | Cancels an SQL statement. | ||
SQLTransact() | Depr | No | V 1.1 | Commits or rolls back a transaction. | ||
SQLCloseCursor() | Core | 95 | V 5 | Commits or rolls back a transaction. | ||
Terminating a Connection | ||||||
SQLDisconnect() | Core | 95 | V 1.1 | Closes the connection. | ||
SQLEndTran() | Core | 95 | V 5 | Ends transaction of a connection. | ||
SQLFreeConnect() | Depr | 95 | V 1.1 | Releases the connection handle. | ||
SQLFreeEnv() | Depr | 95 | V 1.1 | Releases the environment handle. | ||
|