ODBC Function Summary
The following table lists ODBC functions, grouped by type of task, and includes the conformance designation and a brief description of the purpose of each function.
Connecting to a data source
SQLAllocHandle: Obtains an environment, connection, statement, or descriptor handle.
SQLConnect: Connects to a specific driver by data source name, user ID, and password.
SQLDriverConnect: Connects to a specific driver by connection string or requests that the Driver Manager and driver display connection dialog boxes for the user.
SQLBrowseConnect: Returns successive levels of connection attributes and valid attribute values. When a value has been specified for each connection attribute, connects to the data source.
Obtaining information about a driver and data source
SQLDataSources: Returns the list of available data sources.
SQLDrivers: Returns the list of installed drivers and their attributes.
SQLGetInfo: Returns information about a specific driver and data source.
SQLGetFunctions: Returns supported driver functions.
SQLGetTypeInfo: Returns information about supported data types.
Setting and retrieving driver attributes
SQLSetConnectAttr: Sets a connection attribute.
SQLGetConnectAttr: Returns the value of a connection attribute.
SQLSetEnvAttr: Sets an environment attribute.
SQLGetEnvAttr: Returns the value of an environment attribute.
SQLSetStmtAttr: Sets a statement attribute.
SQLGetStmtAttr: Returns the value of a statement attribute.
Setting and retrieving descriptor fields
SQLGetDescField: Returns the value of a single descriptor field.
SQLGetDescRec: Returns the values of multiple descriptor fields.
SQLSetDescField: Sets a single descriptor field.
SQLSetDescRec: Sets multiple descriptor fields.
Preparing SQL requests
SQLPrepare: Prepares an SQL statement for later execution.
SQLBindParameter: Assigns storage for a parameter in an SQL statement.
SQLGetCursorName: Returns the cursor name associated with a statement handle.
SQLSetCursorName: Specifies a cursor name.
SQLSetScrollOptions: Sets options that control cursor behavior.
Submitting requests
SQLExecute: Executes a prepared statement.
SQLExecDirect: Executes a statement.
SQLNativeSql: Returns the text of an SQL statement as translated by the driver.
SQLDescribeParam: Returns the description for a specific parameter in a statement.
SQLNumParams: Returns the number of parameters in a statement.
SQLParamData: Used in conjunction with SQLPutData to supply parameter data at execution time. (Useful for long data values.)
SQLPutData: Sends part or all of a data value for a parameter. (Useful for long data values.)
Retrieving results and information about results
SQLRowCount: Returns the number of rows affected by an insert, update, or delete request.
SQLNumResultCols: Returns the number of columns in the result set.
SQLDescribeCol: Describes a column in the result set.
SQLColAttribute: Describes attributes of a column in the result set.
SQLBindCol: Assigns storage for a result column and specifies the data type.
SQLFetch: Returns multiple result rows.
SQLFetchScroll: Returns scrollable result rows.
SQLGetData: Returns part or all of one column of one row of a result set. (Useful for long data values.)
SQLSetPos: Positions a cursor within a fetched block of data and allows an application to refresh data in the rowset or to update or delete data in the result set.
SQLBulkOperations: Performs bulk insertions and bulk bookmark operations, including update, delete, and fetch by bookmark.
SQLMoreResults: Determines whether there are more result sets available and, if so, initializes processing for the next result set.
SQLGetDiagField: Returns additional diagnostic information (a single field of the diagnostic data structure).
SQLGetDiagRec: Returns additional diagnostic information (multiple fields of the diagnostic data structure).
Obtaining information about the data source’s system tables (catalog functions)
SQLColumnPrivileges: Returns a list of columns and associated privileges for one or more tables.
SQLColumns: Returns the list of column names in specified tables.
SQLForeignKeys: Returns a list of column names that make up foreign keys, if they exist for a specified table.
SQLPrimaryKeys: Returns the list of column names that make up the primary key for a table.
SQLProcedureColumns: Returns the list of input and output parameters, as well as the columns that make up the result set for the specified procedures.
SQLProcedures: Returns the list of procedure names stored in a specific data source.
SQLSpecialColumns: Returns information about the optimal set of columns that uniquely identifies a row in a specified table, or the columns that are automatically updated when any value in the row is updated by a transaction.
SQLStatistics: Returns statistics about a single table and the list of indexes associated with the table.
SQLTablePrivileges: Returns a list of tables and the privileges associated with each table.
SQLTables: Returns the list of table names stored in a specific data source.
Terminating a statement
SQLFreeStmt: Ends statement processing, discards pending results, and, optionally, frees all resources associated with the statement handle.
SQLCloseCursor: Closes a cursor that has been opened on a statement handle.
SQLCancel: Cancels an SQL statement.
SQLEndTran: Commits or rolls back a transaction.
Terminating a connection
SQLDisconnect: Closes the connection.
SQLFreeHandle: Releases an environment, connection, statement, or descriptor handle.