Catalog functions

Catalog functions return information about the DB2® for i database objects with which you are working.

To process ODBC SQLTables requests, logical files are built over the server cross reference file QADBXREF in library QSYS. QADBXREF is a database file for database-maintained cross-reference information that is part of the dictionary function for the server.

The following are the actions for SQLTables when TableType is set to the following:

NULL
Selects all LOGICAL and PHYSICAL files, including SQL SQL TABLES and VIEWS.
TABLE
Selects all PHYSICAL files, including SQL TABLES that are not server files (cross reference or data dictionary).
VIEW
Selects all LOGICAL files, including SQL VIEWS that are not server files (cross reference or data dictionary).
SYSTEM TABLE
Selects all PHYSICAL and LOGICAL files, including SQL VIEWS that are either server files or data dictionary files.
TABLE, VIEW
Selects all LOGICAL and PHYSICAL files, including SQL TABLES and VIEWS that are not server files or data dictionary files.

Non-relational files (files with more than one format) are not selected. Also not selected are indexes, flat files and IDDU-defined files.

The result sets returned by the catalog functions are ordered by table type. In addition to the TABLE and VIEW types, the system has the data source-specific type identifiers of PHYSICAL and LOGICAL files. The PHYSICAL type is handled as a TABLE, and the LOGICAL type is handled as a VIEW.

To process ODBC SQLColumns requests, a logical file is built over the server cross-reference file QADBIFLD in the QSYS library. This logical file selects all relational database files except for indexes. QADBIFLD is a database file for database-maintained cross-reference information that is part of the dictionary function for the server. Specifically, this includes database file column and field information.

For additional information:
The Appendix of the SQL Reference book contains additional information. View an HTML online version of the book, or print a PDF version, from the DB2 for i SQL Reference topic in the IBM® i Information Center.