5 Getting Schema Information : Additional Schema Metadata Collections

Additional Schema Metadata Collections
All DataDirect providers support additional MetaData collections.
Result sets for each Metadata collection are defined in the section for each collection. However, it is important to note that the DataDirect Connect for ADO.NET data providers will not return exactly the same result set for each Metadata collection. As is standard coding practice in .NET, the data provider returns only the columns of the result set that apply to it.
Additionally, it is important to note that a data provider might not implement every Metadata collection. If a collection does not apply to a particular database, then the data provider must not implement that collection. Finally, not all restrictions are the same across providers for each collection. Restrictions that do not apply to a given data source are not implemented for that data provider's Metadata collections (for example, Catalog restrictions are not implemented for the Oracle data provider).
Therefore, it is important that applications that use the Metadata collections conform to the following best practices:
Catalogs Schema Collection
Description: The Catalogs collection identifies the physical attributes associated with catalogs that are accessible from the DBMS. For some systems, there may be only one catalog.
Number of restrictions: 1
Restrictions available: CATALOG_NAME
Sort order: CATALOG_NAME
NOTE: The Oracle data provider does not support the Catalogs collection.
 

1
All classes are System.XXX. For example, System.String.

Columns Schema Collection
Description: The Columns collection identifies the columns of tables (including views) defined in the catalog that are accessible to a given user. Table 5-9 identifies the columns of tables that are defined in the catalog that are accessible to a given user.
Number of restrictions: 3
Restrictions available: TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME
Sort order: TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION
 

1
All classes are System.XXX. For example, System.String.

ForeignKeys Schema Collection
Description: The ForeignKeys collection identifies the foreign key columns that are defined in the catalog by a given user.
Number of restrictions: 4
Restrictions available: PK_TABLE_SCHEMA, PK_TABLE_NAME, FK_TABLE_SCHEMA, FK_TABLE_NAME
Sort order: FK_TABLE_SCHEMA, FK_TABLE_NAME
 

1
All classes are System.XXX. For example, System.String

Indexes Schema Collection
Description: The Indexes collection identifies the indexes that are defined in the catalog that are owned by a given user.
Number of restrictions: 4
Restrictions available: TABLE_SCHEMA, INDEX_NAME, TYPE, TABLE_NAME
Sort order: UNIQUE, TYPE, INDEX_CATALOG, INDEX_SCHEMA, INDEX_NAME, ORDINAL_POSITION
 

1
All classes are System.XXX. For example, System.String.

PrimaryKeys Schema Collection
Description: The PrimaryKeys collection identifies the primary key columns that are defined in the catalog by a given user.
Number of restrictions: 2
Restrictions available: TABLE_SCHEMA, TABLE_NAME
Sort order: TABLE_SCHEMA, TABLE_NAME
 

1
All classes are System.XXX. For example, System.String.

ProcedureParameters Schema Collection
Description: The ProcedureParameters collection returns information about the parameters and return codes of procedures that are part of the Procedures collection.
Number of restrictions: 4
Restrictions available: PROCEDURE_CATALOG, PROCEDURE_SCHEMA, PROCEDURE_NAME, PARAMETER_NAME
Sort order: PROCEDURE_CATALOG, PROCEDURE_SCHEMA, PROCEDURE_NAME, ORDINAL_POSITION
 
DbNull for all other types of parameters.
The parameter name. DbNull if the parameter is not named.

1
All classes are System.XXX. For example, System.String.

Procedures Schema Collection
Description: The Procedures schema collection identifies the procedures that are defined in the catalog. When possible, only procedures for which the connected user has execute permission should be returned.
Number of restrictions: 4
Restrictions available: PROCEDURE_CATALOG, PROCEDURE_SCHEMA, PROCEDURE_NAME, PROCEDURE_TYPE
Sort order: PROCEDURE_CATALOG, PROCEDURE_SCHEMA, PROCEDURE_NAME
 
The procedure definition, or return DbNull if the data provider does not have this information available.

1
All classes are System.XXX. For example, System.String.

Schemata Schema Collection
Description: The Schemata collection identifies the schemas that are owned by a given user.
Number of restrictions: 3
Restrictions Available: CATALOG_NAME, SCHEMA_NAME, SCHEMA_OWNER
Sort order: CATALOG_NAME, SCHEMA_NAME, SCHEMA_OWNER
 

1
All classes are System.XXX. For example, System.String

Tables Schema Collection
Number of Restrictions: 3
Restrictions Available: TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE
Sort order: TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME
Description: The Tables collection identifies the tables (including views) that are defined in the catalog that are accessible to a given user.
NOTE: For the .NET Framework datatypes, all classes are System.xxx.
 
DbNull if no description is associated with the column.
TablePrivileges Schema Collection
Description: The TablePrivileges schema collection identifies the privileges on tables that are defined in the catalog that are available to or granted by a given user.
Number of restrictions: 4
Restrictions available: TABLE_SCHEMA, TABLE_NAME, GRANTOR, GRANTEE
Sort order: TABLE_SCHEMA, TABLE_NAME, PRIVILEGE_TYPE
 

1
All classes are System.XXX. For example, System.String.

Views Schema Collection
Description: The Views collection identifies the views that are defined in the catalog and that are accessible to a given user.
Number of restrictions: 2
Restrictions available: TABLE_SCHEMA, TABLE_NAME
Sort order: TABLE_SCHEMA, TABLE_NAME
 
The date when the view was created or DbNull if the data provider does not have this information.
Date when the view definition was last modified or DbNull if the data provider does not have this information.

1
All classes are System.XXX. For example, System.String