TABLES Schema Rowset

Standard Mapping

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.
The following table lists the five of the nine columns in the OLE DB specification that contain data.
Standard Mapping
Column Name
Type Indicator
Mapped Value
Restrictions Supported?
TABLE_NAME
DBTYPE_WSTR
Table name. The value is either libname.memname (SAS/SHARE, IOM, and Base SAS providers) or memname (local provider).
Yes
TABLE_TYPE
DBTYPE_WSTR
Table type. The value is either TABLE (all providers) or VIEW (SAS/SHARE, IOM, and Base SAS providers).
No
DESCRIPTION
DBTYPE_WSTR
Table description. In the case of a SAS data set, this value is the data set's label.
No
DATE_CREATED
DBTYPE_DATE
Table creation date.
No
DATE_MODIFIED
DBTYPE_DATE
Most recent modification date.
No
Note: For more information about restrictions, see How to Restrict the Rows That Are Returned.

Rowset Extensions

All of the SAS 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.
Rowset Extensions
Column Name
Type Indicator
Mapped Member
Description
LOGICAL_RECORD
_COUNT
DBTYPE_I4
lLogicalRecordCount
The logical number of records in the SAS 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 SAS data set, which indicates the number of slots physically allocated for records in the data set. This value can 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 SAS 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 SAS data set; otherwise, it is VARIANT_FALSE.
SAS_DATASET_TYPE
DBTYPE_WSTR
wszDataSetType
The SAS data set type.
SAS_DATASET_LABEL
DBTYPE_WSTR
wszDataSetLabel
A user-defined attribute of up to 200 characters that is used for documenting the SAS data set.
SAS_DATASET_ENCODING
DBTYPE_I4
lEncoding
The encoding value from the SAS data set.
SAS_DATASET_WINDOWS_CODEPAGE
DBTYPE_I4
lWinCP
The Windows code page value for the SAS data set.