SQL for the WMI ODBC Adapter

This section lists in alphabetical order only the supported Windows Management Instrumentation (WMI) ODBC functions. The descriptions of the functions include design issues relevant to the implementation of the function.

Note  For more information about support or requirements for installation on a specific operating system, see Operating System Availability of WMI Components.

For more information about ODBC functions, see the ODBC Programmer's Reference in the Data Services section of the Microsoft Windows Software Development Kit (SDK).

The following table lists all supported WMI ODBC functions. Functions with enhanced WMI features are linked to separate topics.

SQLAllocConnectStandard ODBC function that allocates memory for a connection handle.
SQLAllocEnvAllocates memory for an environment handle.
SQLAllocStmtAllocates memory for a statement handle. This function has been modified to support inclusion of table qualifiers.
SQLBindColBinds application data buffers to columns in the result set.
SQLBindParameterBinds a buffer to a parameter marker in an SQL statement.
SQLCancelUsed to cancel a function executing asynchronously on a statement handle that needs data.
SQLColAttributes Returns descriptor information for a column in a result set. This function is modified to use information from the WMI repository.
SQLColumns Returns a list of column names in specified tables.
SQLConnectConnects to a data source. The user of SQLConnect must specify only a data source name.
SQLDataSourcesReturns information about a data source. This function is implemented in the ODBC Driver Manager.
SQLDescribeColSimilar to SQLColumns attributes. Imposes no requirements upon the property qualifiers in the WMI class objects beyond those specified in SQLColumns.
SQLDisconnectCloses the connection associated with a specific connection handle.
SQLDriverConnect Connects an application to a data source.
SQLDriversLists driver descriptions and driver attribute keywords. This function is implemented in the ODBC Driver Manager.
SQLError Provides support for the return of the standard error codes.
SQLExecDirectExecutes a new, prepareable SQL statement.
SQLExecuteExecutes a prepared statement, using the current values of the parameter marker variables, if any parameter markers exist in the statement.
SQLExtendedFetchNot supported.
SQLFetchRetrieves one row from a result set into the locations specified by the previous calls to SQLBindCol. Prepares the driver for a call to SQLGetData for the unbound columns.
SQLFreeConnectReleases a connection handle and frees all memory allocated for the handle.
SQLFreeEnvCloses the adapter and releases all associated memory.
SQLFreeStmtStops processing associated with a specific hstmt handle, closes any open cursors associated with the hstmt handle, discards pending results, and optionally frees all resources associated with the statement handle.
SQLGetConnectOption Returns the current setting of a connection option.
SQLGetCursorNameReturns the cursor name associated with a specified statement.
SQLGetDataRetrieves data for a single column in the result set. It can be called multiple times to retrieve variable-length data in parts.
SQLGetFunctions Returns information about whether a driver supports a specific ODBC function. This function has been modified to indicate that the data source write operations are unsupported.
SQLGetInfo Returns general information about the adapter and data source associated with a connection.
SQLGetStatementOption Returns the current setting of a statement option.
SQLGetTypeInfo Returns information about data types supported by the data source. The driver returns the information in the form of an SQL result set.
SQLMoreResultsDetermines whether more results are available on a statement containing SELECT, UPDATE, INSERT, or DELETE statements and, if so, initializes processing for those results.
SQLNumResultColsReturns the number of columns in a result set cursor.
SQLParamDataUsed in conjunction with SQLPutData to supply parameter data at statement execution time.
SQLPreparePrepares an SQL statement by planning how to optimize and execute the statement. The SQL statement is compiled for execution by SQLExecDirect.
SQLPutDataAllows an application to send data for a parameter or column to the driver at statement execution time. This function can be used to send character or binary data values in parts to a column with a character, binary, or data source–specific data type (for example, parameters of the SQL_LONGVARBINARY or SQL_LONGVARCHAR types).
SQLRowCountReturns the number of rows affected by an UPDATE, INSERT, or DELETE statement; an SQL_ADD, SQL_UPDATE_BY_BOOKMARK, or SQL_DELETE_BY_BOOKMARK operation in SQLBulkOperations; or an SQL_UPDATE or SQL_DELETE operation in SQLSetPos.
SQLSetConnectOptionSets options that govern aspects of connections. For a discussion of the options and what they mean for the adapter, see SQLGetConnectOption.
SQLSetCursorNameAssociates a cursor name with an active statement handle.
SQLSetScrollOptionsSuperseded by SQLSetStmtOption in ODBC version 2.0. ODBC 2.0 Extension Level 2 adapters should implement SQLSetScrollOptions for backward compatibility with ODBC 1.0 applications.
SQLSetStmtOptionSets options related to a statement handle, hstmt. For a discussion of the options and what they mean for the adapter, see SQLGetStatementOption.
SQLSpecialColumnsRetrieves the optimal set of columns that uniquely identifies a row in the table. Only the SQL_BEST_ROWID value for the fColType parameter is supported.
SQLStatisticsRetrieves a list of statistics about a single table and the indexes associated with the table. The driver returns the information as a result set.
SQLTables Returns a list of table names stored in a specific data source.