Call Level Interface (CLI) APIs
The CLI APIs are:
- Allocate a statement handle (SQLAllocStmt) allocates a new statement handle and associates it with the connection specified by the connection handle.
- Allocate connection handle (SQLAllocConnect) allocates a connection handle and associated resources within the environment identified by the input environment handle.
- Allocate environment handle (SQLAllocEnv) allocates an environment handle and associated resources.
- Allocate handle (SQLAllocHandle) allocates any type of handle.
- Bind a buffer to a parameter marker (SQLBindParam) associates (binds) an application variable to a parameter marker in an SQL statement..
- Bind a column to an application variable (SQLBindCol) associates (binds) columns in a result set to application variables (storage buffers) for all data types.
- Bind a parameter marker to a buffer (SQLBindParameter) associates (binds) parameter markers in an SQL statement to application variables.
- Bind LOB file reference to LOB column (SQLBindFileToCol) associates (binds) a LOB column in a result set to a file reference or an array of file references.
- Bind LOB file reference to LOB parameter (SQLBindFileToParam) associates (binds) a parameter marker in an SQL statement to a file reference or an array of file references.
- Cancel statement (SQLCancel) attempts to end the processing of an ongoing SQL statement operation that is executing asynchronously.
- Close cursor statement (SQLCloseCursor) closes the open cursor on a statement handle.
- Commit or roll back a transaction (SQLEndTran) commits or rolls back the current transaction in the connection.
- Connect to a data source (SQLConnect) establishes a connection to the target database.
- Connect to a data source (expanded) (SQLDriverConnect) establishes a connection to the target database, but SQLDriverConnect() uses a connection string to determine the data source name, user ID and password.
- Connect to a data source (expanded, UTF-16 support) (SQLDriverConnectW) establishes a connection to the target database, but SQLDriverConnectW() uses a connection string to determine the data source name, user ID and password.
- Connect to a data source (UTF-16 support) (SQLConnectW) establishes a connection to the target database.
- Copy description statement (SQLCopyDesc) copies the fields of the data structure associated with the source handle to the data structure associated with the target handle.
- Describe column attributes (SQLDescribeCol) returns the result descriptor information (column name, type, precision) for the indicated column in the result set generated by a SELECT statement.
- Describe column attributes (UTF-16 support) (SQLDescribeColW) returns the result descriptor information (column name, type, precision) for the indicated column in the result set generated by a SELECT statement.
- Determine if there are more result sets (SQLMoreResults) determines whether there is more information available on the statement handle which has been associated with a stored procedure that is returning result sets.
- Disconnect from a data source (SQLDisconnect) closes the connection associated with the database connection handle.
- Execute a statement (SQLExecute) executes a statement, that was successfully prepared using SQLPrepare(), once or multiple times.
- Execute a statement directly (SQLExecDirect) directly runs the specified SQL statement.
- Execute a statement directly (UTF-16 support) (SQLExecDirectW) directly runs the specified SQL statement.
- Fetch array of rows (SQLExtendedFetch) extends the function of SQLFetch() by returning a block of data containing multiple rows (called a rowset), in the form of an array, for each bound column.
- Fetch from a scrollable cursor (SQLFetchScroll) positions the cursor based on the requested orientation, then retrieves any bound columns.
- Fetch next row (SQLFetch) advances the cursor to the next row of the result set, and retrieves any bound columns.
- Free (or reset) a statement handle (SQLFreeStmt) ends processing on the statement referenced by the statement handle.
- Free a handle (SQLFreeHandle) invalidates and frees a handle.
- Free connection handle (SQLFreeConnect) invalidates and frees the connection handle.
- Free environment handle (SQLFreeEnv) invalidates and frees the environment handle.
- Get column information for a table (SQLColumns) returns a list of columns in the specified tables.
- Get column information for a table (UTF-16 support) (SQLColumnsW) returns a list of columns in the specified tables.
- Get cursor name (SQLGetCursorName) returns the cursor name associated with the input statement handle.
- Get cursor name (UTF-16 support) (SQLGetCursorNameW) returns the cursor name associated with the input statement handle.
- Get data from a column (SQLGetData) retrieves data for a single column in the current row of the result set.
- Get data type information (SQLGetTypeInfo) returns information about the data types that are supported by the DBMSs associated with DB2 for i CLI. The information is returned in an SQL result set.
- Get data type information (UTF-16 support) (SQLGetTypeInfoW) returns information about the data types that are supported by the DBMSs associated with DB2 for i CLI. The information is returned in an SQL result set.
- Get descriptor field (SQLGetDescField) obtains a value from a descriptor.
- Get descriptor field (UTF-16 support) (SQLGetDescFieldW) obtains a value from a descriptor.
- Get descriptor record (SQLGetDescRec) obtains an entire record from a descriptor.
- Get descriptor record (UTF-16 support) (SQLGetDescRecW) obtains an entire record from a descriptor.
- Get functions (SQLGetFunctions) queries whether a specific function is supported.
- Get general information (SQLGetInfo) returns general information (including supported data conversions) about the DBMS that the application is currently connected to.
- Get general information (UTF-16 support) (SQLGetInfoW) returns general information (including supported data conversions) about the DBMS that the application is currently connected to.
- Get index and statistics information for a base table (SQLStatistics) retrieves index information for a given table.
- Get index and statistics information for a base table (UTF-16 support) (SQLStatisticsW) retrieves index information for a given table.
- Get input/output parameter information for a procedure (SQLProcedureColumns) returns a list of input and output parameters associated with a procedure.
- Get input/output parameter information for a procedure (UTF-16 support) (SQLProcedureColumnsW) returns a list of input and output parameters associated with a procedure.
- Get list of data sources (SQLDataSources) returns a list of target databases available, one at a time.
- Get list of data sources (UTF-16 support) (SQLDataSourcesW) returns a list of target databases available, one at a time.
- Get list of procedure names (SQLProcedures) returns a list of procedure names that have been registered on the system and match the specified search pattern.
- Get list of procedure names (UTF-16 support) (SQLProceduresW) returns a list of procedure names that have been registered on the system and match the specified search pattern.
- Get native SQL text (SQLNativeSql) shows how DB2 for i CLI interprets vendor escape clauses.
- Get native SQL text (UTF-16 support) (SQLNativeSqlW) shows how DB2 for i CLI interprets vendor escape clauses.
- Get next parameter for which a data value is needed (SQLParamData) is used with SQLPutData() to send long data in pieces.
- Get number of parameters in an SQL statement (SQLNumParams) returns the number of parameter markers in an SQL statement.
- Get number of result columns (SQLNumResultCols) returns the number of columns in the result set associated with the input statement handle.
- Get primary key columns of a table (SQLPrimaryKeys) returns a list of column names that comprise the primary key for a table.
- Get primary key columns of a table (UTF-16 support) (SQLPrimaryKeysW) returns a list of column names that comprise the primary key for a table.
- Get privileges associated with a table (SQLTablePrivileges) returns a list of tables and associated privileges for each table.
- Get privileges associated with a table (UTF-16 support) (SQLTablePrivilegesW) returns a list of tables and associated privileges for each table.
- Get privileges associated with the columns of a table (SQLColumnPrivileges) returns a list of columns and associated privileges for the specified table.
- Get privileges associated with the columns of a table (UTF-16 support) (SQLColumnPrivilegesW) returns a list of columns and associated privileges for the specified table.
- Get row count (SQLRowCount) returns the number of rows in a table affected by an UPDATE, INSERT, or DELETE statement executed against the table, or a view based on the table.
- Get special (row identifier) columns (SQLSpecialColumns) returns unique row identifier information (primary key or unique index) for a table.
- Get special (row identifier) columns (UTF-16 support) (SQLSpecialColumnsW) returns unique row identifier information (primary key or unique index) for a table.
- Get SQL dialect or conformance information (SQLLanguages) returns SQL dialect or conformance information.
- Get table information (SQLTables) returns a list of table names and associated information stored in the system catalogs of the connected data source.
- Get table information (UTF-16 support) (SQLTablesW) returns a list of table names and associated information stored in the system catalogs of the connected data source.
- Get the list of foreign key columns (SQLForeignKeys) returns information about foreign keys for the specified table.
- Get the list of foreign key columns (UTF-16 support) (SQLForeignKeysW) returns information about foreign keys for the specified table.
- Get the value of a connection attribute (SQLGetConnectAttr) returns the current settings for the specified connection option.
- Get the value of a connection attribute (UTF-16 support) (SQLGetConnectAttrW) returns the current settings for the specified connection option.
- Get the value of a statement attribute (SQLGetStmtAttr) returns the current settings of the specified statement attribute.
- Get the value of a statement attribute (UTF-16 support) (SQLGetStmtAttrW) returns the current settings of the specified statement attribute.
- Obtain column attributes (SQLColAttributes) obtains an attribute for a column of the result set and is also used to determine the number of columns.
- Obtain column attributes (UTF-16 support) (SQLColAttributesW) obtains an attribute for a column of the result set and is also used to determine the number of columns.
- Passing data value for a parameter (SQLPutData) is called following an SQLParamData() call returning SQL_NEED_DATA to supply parameter data values.
- Prepare a statement (SQLPrepare) associates an SQL statement with the input statement handle and sends the statement to the DBMS to be prepared.
- Prepare a statement (UTF-16 support) (SQLPrepareW) associates an SQL statement with the input statement handle and sends the statement to the DBMS to be prepared.
- Process the next result set (SQLNextResult) determines whether there is more information available on the statement handle which has been associated with a stored procedure that is returning result sets.
- Release all environment resources (SQLReleaseEnv) invalidates and frees the environment handle.
- Retrieve error information (SQLError) returns the diagnostic information associated with the most recently called DB2 for i CLI function for a particular statement, connection, or environment handle.
- Retrieve error information (UTF-16 support) (SQLErrorW) returns the diagnostic information associated with the most recently called DB2 for i CLI function for a particular statement, connection, or environment handle.
- Retrieve length of a string value (SQLGetLength) is used to retrieve the length of a large object value referenced by a large object locator that has been returned from the data source (as a result of a fetch or an SQLGetSubString() call) during the current transaction.
- Retrieve one column of a row of the result set (SQLGetCol) retrieves data for a single column in the current row of the result set.
- Retrieve portion of a string value (SQLGetSubString) retrieves a portion of a large object value referenced by a large object locator that has been returned from the data source (returned by a fetch or a previous SQLGetSubString() call) during the current transaction.
- Retrieve portion of a string value (UTF-16 support) (SQLGetSubStringW) retrieves a portion of a large object value referenced by a large object locator that has been returned from the data source (returned by a fetch or a previous SQLGetSubStringW() call) during the current transaction.
- Return a column attribute (SQLColAttribute) obtains an attribute for a column of the result set and is also used to determine the number of columns. SQLColAttribute() is a more extensible alternative to the SQLDescribeCol() function.
- Return a column attribute (UTF-16 support) (SQLColAttributeW) obtains an attribute for a column of the result set and is also used to determine the number of columns.
- Return description of a parameter marker (SQLDescribeParam) returns the description of a parameter marker associated with a prepared SQL statement.
- Return diagnostic information (concise) (SQLGetDiagRec) returns the diagnostic information associated with the most recently called DB2 for i CLI function for a particular statement, connection, or environment handle.
- Return diagnostic information (concise, UTF-16 support) (SQLGetDiagRecW) returns the diagnostic information associated with the most recently called DB2 for i CLI function for a particular statement, connection, or environment handle.
- Return diagnostic information (extensible) (SQLGetDiagField) returns the diagnostic information associated with the most recently called DB2 for i CLI function for a particular statement, connection, or environment handle.
- Return diagnostic information (extensible, UTF-16 support) (SQLGetDiagFieldW) returns the diagnostic information associated with the most recently called DB2 for i CLI function for a particular statement, connection, or environment handle.
- Return starting position of string (SQLGetPosition) returns the starting position of one string within a LOB value (the source).
- Return starting position of string (UTF-16 support) (SQLGetPositionW) returns the starting position of one string within a LOB value (the source).
- Return current setting of a connect option (SQLGetConnectOption) returns the current settings for the specified connection option.
- Return current setting of a connect option (UTF-16 support) (SQLGetConnectOptionW) returns the current settings for the specified connection option.
- Return current setting of a statement option (SQLGetStmtOption) returns the current settings of the specified statement option.
- Return current setting of a statement option (UTF-16 support) (SQLGetStmtOptionW) returns the current settings of the specified statement option.
- Return current setting of an environment attribute (SQLGetEnvAttr) returns the current settings for the specified environment attribute.
- Set a connection attribute (SQLSetConnectAttr) sets connection attributes for a particular connection.
- Set a connection attribute (UTF-16 support) (SQLSetConnectAttrW) sets connection attributes for a particular connection.
- Set a descriptor field (SQLSetDescField) sets a field in a descriptor.
- Set a descriptor field (UTF-16 support) (SQLSetDescFieldW) sets a field in a descriptor.
- Set a descriptor record (SQLSetDescRec) sets all the attributes for a descriptor record.
- Set a statement attribute (SQLSetStmtAttr) sets an attribute of a specific statement handle.
- Set a statement attribute (UTF-16 support) (SQLSetStmtAttrW) sets an attribute of a specific statement handle.
- Set connection option (SQLSetConnectOption) sets connection attributes for a particular connection.
- Set connection option (UTF-16 support) (SQLSetConnectOptionW) sets connection attributes for a particular connection.
- Set cursor name (SQLSetCursorName) associates a cursor name with the statement handle.
- Set cursor name (UTF-16 support) (SQLSetCursorNameW) associates a cursor name with the statement handle.
- Set environment attribute (SQLSetEnvAttr) sets an environment attribute for the current environment.
- Set parameter (SQLSetParam) associates (binds) an application variable to a parameter marker in an SQL statement.
- Set statement option (SQLSetStmtOption) sets an attribute of a specific statement handle.
- Set statement option (UTF-16 support) (SQLSetStmtOptionW) sets an attribute of a specific statement handle.
- Specify an input array for a parameter (SQLParamOptions) provides the ability to set multiple values for each parameter set by SQLBindParameter().
- Transaction management (SQLTransact) commits or rolls back the current transaction in the connection.