Chapter Contents

Previous

Next
SAS ODBC Driver User's Guide and Programmer's Reference

Support for and Implementation of ODBC Functions

Microsoft's ODBC specification defines three levels of support for ODBC functions: CORE, LEVEL 1, and LEVEL 2. The SAS ODBC driver is ODBC 2.0 compliant and supports LEVEL 1 functionality, with the exception of those functions associated with cursors (SQLGetCursorName, SQLSetCursorName) and large data fields (SQLParamData, SQLPutData, SQLExtendedFetch), which are not supported. The following tables provide explanations of the functions that are not supported or whose implementation details may be noteworthy to applications developers.


CORE Functions

CORE Functions
Function Name Purpose SAS ODBC Driver Implementation



SQLBindParameter Assigns storage for a parameter in an SQL statement Note that SQL_DATA_AT_EXEC is not supported because SAS does not support large data fields.
SQLCancel Cancels an SQL statement This function is used only in asynchronous mode, which SAS does not support. The SAS System's interprocess communication library does not provide any way to interrupt a transaction in process. SQLCancel does not cause an active statement to terminate immediately, and it does not halt an operation that is already in process. This is allowable within the function specification. This call always returns as successful.
SQLColAttributes Describes the attributes of a column in the result set A common reason for applications to call this function is to determine whether a column of data is a dollar amount. With SAS data sets or views, this is inferred from the FORMAT. See Supported Data Types for more information about SAS FORMATs.
SQLGetCursorName Returns the cursor name that is associated with a statement handle SAS does not support cursors, so this function returns SQL_ERROR with SQLSTATE set to IM001 ("Driver does not support this function").
SQLPrepare Prepares an SQL statement for later execution Does not check syntax at this point; syntax checking is done later in the SQLExecute call by the server.
SQLSetCursorName Specifies a cursor name SAS does not support cursors, so this function returns SQL_ERROR with SQLSTATE set to IM001 ("Driver does not support this function").
SQLTransact Commits or rolls back a transaction Always returns SQL_SUCCESS for SQL_COMMIT. Returns an error for SQL_ROLLBACK because SAS does not support transactions.


LEVEL 1 Functions

LEVEL 1 Functions
Function Name Purpose SAS ODBC Driver Implementation
SQLColumns Returns the list of column names from specified tables SAS uses a specially formatted query to query the virtual table DICTIONARY.COLUMNS.
SQLDriverConnect Connects to a specific driver by connection string or requests that the Driver Manager and the driver display connection dialogs for the user SAS makes use of the same dialogs that are used in configuration. If input was adequate, it continues with the connection rather than saving the parameters. However, in many cases input is not required. The connection to the host is made at this time.
SQLParamData Returns the storage value that has been assigned to a parameter for which data will be sent at execution time This function is used for large data fields, which SAS does not support, so the function returns SQL_ERROR with SQLSTATE set to IM001 ("Driver does not support this function").
SQLPutData Sends part or all of a data value for a parameter This function is used for large data fields, which SAS does not support, so the function returns SQL_ERROR with SQLSTATE set to IM001 ("Driver does not support this function").
SQLSpecialColumns Retrieves information about the optimal set of columns that uniquely identifies a row in a specified table, or about the columns that are automatically updated when any value in the row is updated by a transaction The SAS ODBC driver uses a query on the DICTIONARY.INDEXES view to obtain this information.
SQLStatistics Retrieves statistics about a single table and the list of indexes that are associated with the table The SAS ODBC driver uses a query on the DICTIONARY.INDEXES view to obtain this information.
SQLTables Returns the list of table names stored in a specific data source The SAS ODBC driver uses a query on the DICTIONARY.TABLES and DICTIONARY.MEMBERS views to obtain this information.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.