The TABLES schema rowset returns metadata about all of the tables in the current data source. Each row in the TABLES schema rowset corresponds to an individual table. Each SAS data set is considered to be a table.
Only five of the nine columns in the OLE DB specification contain data as illustrated by the following table.
Column Name | Type Indicator | Mapped Value | Restrictions Supported? |
---|---|---|---|
TABLE_NAME | DBTYPE_WSTR | Table name. The value is either libname.memname (SAS/SHARE and IOM providers) or memname (local provider). | Yes |
TABLE_TYPE | DBTYPE_WSTR | Table type. The value is either TABLE (all providers) or VIEW (SAS/SHARE and IOM providers only) | No |
DESCRIPTION | DBTYPE_WSTR | Table description. In the case of a SAS data set, this is the data set's label. | No |
DATE_CREATED | DBTYPE_DATE | Table creation date. | No |
DATE_MODIFIED | DBTYPE_DATE | Most recent modification date. | No |
Restrictions enable an OLE DB consumer to restrict the rows that are returned in a schema rowset by IDBSchemaRowset::GetRowset. A restriction is a value for a specific column. When a restriction is passed to IDBSchemaRowset::GetRowset, all rows that are returned in the schema rowset must match the restriction value on the specified column. Restriction values do not support pattern matching or wildcards. For example, the restriction value D_F matches D_F but not DEF.
An OLE DB consumer can programmatically determine the columns on which the providers support restrictions by calling IDBSchemaRowset::GetSchemas.
All four providers extend the TABLES schema rowset to include metadata that is specific to SAS data sets. These custom schema rowset columns include the same information that is returned by the ISASDataSetInfo interface. However, there are some differences in how the information is made available. Specifically, the ISASDataSetInfo interface returns SAS metadata one data set at a time and is limited to OLE DB consumers. By contrast, the TABLES schema rowset extensions include all tables (data sets) in a data source at one time and are available to both OLE DB and ADO consumers.
Each custom column maps to a member of the SASDATASETINFO structure that is returned by ISASDataSetInfo::GetDataSetInfo. A fifth member in that structure, pwszLabel, does not have a corresponding custom column because it returns a data set label that is included in the OLE DB specification's standard DESCRIPTION column.
The following table lists the columns that are added to the TABLES schema rowset. The columns are returned following the standard columns in the OLE DB specification, and in the order in which they appear in the following table.
Column Name | Type Indicator | Mapped Member | Description |
---|---|---|---|
LOGICAL_RECORD_COUNT | DBTYPE_I4 | lLogicalRecordCount | The logical number of records in the data set, which is the number of records you would encounter if you positioned at the beginning of the table and read sequentially until you encountered "end of file." If the number of records is unknown, -1 is returned. |
PHYSICAL_RECORD_COUNT | DBTYPE_I4 | lPhysicalRecordCount | The physical number of records that are in the data set, which indicates the number of slots physically allocated for records in the data set. This may be greater than the number of logical records. If the number of records is unknown, -1 is returned. |
RECORD_LENGTH | DBTYPE_I4 | lRecordLength | The number of bytes that are required to physically store a row of data in the data set. The record length multiplied by the physical record count indicates the magnitude of the data set that is on disk but not the specific size. |
COMPRESSED | DBTYPE_WSTR | pwszCompressionRoutine | The name of the compression algorithm used. If no compression is set, then the value is "NO." |
INDEXED | DBTYPE_BOOL | fIsIndexed | This column is set to VARIANT_TRUE when an index exists on the data set; otherwise, it is VARIANT_FALSE. |
Note: For definitions of the type indicators, see "Type Indicators" in Microsoft's OLE DB specification documentation.