IDBSchemaRowset: Notes

Limitations

  • The ODBC Provider might not support restrictions on the CATALOGS and SCHEMATA schema rowsets.

  • IDBSchemaRowset::GetSchema might not support the schema restriction on any schema on any ODBC driver. The ODBC Provider will incorrectly report this as a supported restriction because ODBC drivers cannot export information about their support of restrictions to the ODBC Provider.

  • IDBSchemaRowset::GetRowset features limited support for the following schema rowsets with most data source objects:

    FOREIGN_KEYS

    PRIMARY_KEYS

    STATISTICS

    Consumers must restrict their calls by table name or the ODBC Provider will return an empty result set. This limitation does not occur on Microsoft SQL Server 4.21.

  • On Microsoft SQL Server data stores, IDBSchemaRowset::GetRowset(DBSCHEMA_PROCEDURE_COLUMNS) is unsupported. Consumers who need rowset information about stored procedures should prepare a query that includes the stored procedure and call IColumnsInfo::GetColumnInfo.

  • A restriction on table name is required when calling IDBSchemaRowset::GetRowset(DBSCHEMA_INDEXES). This restriction must be used because ODBC function SQLStatistics returns information about a single table and the ODBC Provider uses this function to return information from the data store. If the restriction is not applied, the ODBC Provider returns an empty result set.

  • The PROVIDER_TYPES schema rowset is not sorted by the ODBC Provider.

  • SQL Server will return names similar but not matching when restrictions are placed on the PROCEDURE_NAMES column. When GetRowset is called for PROCEDURES and PROCEDURE_PARAMETERS schema rowsets, and a name restriction is specified, the PROCEDURE NAMES returned in the result set might not exactly match the restriction value, but might have ";N" appended, where N is a number. Also, if the ";N" is used in the PROCEDURE NAME restriction, the provider will return an empty result set even if a procedure name is appended with that number.

Implementation Notes

  • The ODBC Provider cannot support restrictions on schema columns if the restrictions are not supported in the underlying ODBC driver.

  • NULL values are returned in many columns that ANSI SQL-92 specifies as NOT NULL. These are cases in which the information is not available by means of ODBC.

  • Schema rowsets do not expose IColumnsRowset or IRowsetLocate.

  • The COLUMNS schema rowset is dependent on the information returned in the ODBC driver's implementation of SQLColumns. Since ODBC does not return ordinal information, the ODBC Provider always sets the value of ORDINAL_POSITION to NULL.

    The ODBC Provider returns any driver-specific columns that the ODBC driver returns in SQLColumns. This information is returned in columns beyond those described in the OLE DB specification.

    These additional columns include:

    • ORDINAL, which is returned by the Microsoft? Access ODBC driver.

    • ss_data_type and colid, which are returned by the Microsoft SQL Server 6.0 ODBC driver.

    • "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE", and "SS_DATA_TYPE", which are returned by the Microsoft SQL Server 6.5 ODBC driver.

  • In the INDEXES schema rowset, the value of the TYPE column is set to DBPROPVAL_IT_BTREE if the value of the TYPE column returned by SQLStatistics is SQL_INDEX_CLUSTERED. The value of the NULL_COLLATION column is set to the value returned by SQLGetInfo for the SQL_NULL_COLLATION option.

  • In the PROVIDER_TYPES schema rowset, the value of the DATA_TYPE column is set to DBTYPE_BYTES or DBTYPE_IUNKNOWN if the value of the DATA_TYPE column returned by SQLGetTypeInfo is a driver-specific SQL data type indicator.

  • The PROVIDER_TYPES schema rowset does not support any restrictions.

This topic is a part of: