The views contained in a DB2 UDB for iSeries catalog are described in this section. The database manager maintains a set of tables containing information about the data in each relational database. These tables are collectively known as the catalog. The catalog tables contain information about tables, user-defined functions, distinct types, parameters, procedures, packages, views, indexes, aliases, sequences, constraints, triggers, and languages supported by DB2 UDB for iSeries. The catalog also contains information about all relational databases that are accessible from this system.
There are three classes of catalog views:
The iSeries catalog tables and views are modeled after the ANS and ISO catalog views, but are not identical to the ANS and ISO catalog views. These tables and views are compatible with prior releases of DB2 UDB for iSeries.
These tables and views exist in schemas QSYS and QSYS2.
The catalog tables and views contain information about all tables, parameters, procedures, functions, distinct types, packages, views, indexes, aliases, sequences, triggers, and constraints in the entire relational database. When an SQL schema is created, an additional set of these views (except SYSPARMS, SYSPROCS, SYSFUNCS, SYSROUTINES, SYSROUTINEDEP, and SYSTYPES) are created into the schema that only contain information about tables, packages, views, indexes, and constraints in that schema.
The ODBC and JDBC catalog views are designed to satisfy ODBC and JDBC metadata API requests. For example, SQLCOLUMNS. These views are compatible with views on DB2 UDB for z/OS and DB2 UDB LUW Version 8. These views will be modified as ODBC or JDBC enhances or modifies their metadata APIs.
These views exist in schema SYSIBM.
The ANS and ISO catalog views are designed to comply with the ANS and ISO SQL standard (the Information Schema catalog views). These views will be modified as the ANS and ISO standard is enhanced or modified.
There are several columns in these views that are reserved for future standard enhancements.
There are two versions of these views:
If you use of this set of catalog views to prevent users from seeing any information about objects to which they have no privilege, you should revoke privileges to the other catalog views from users and PUBLIC.
For example, assume that a user has the SELECT privilege to the QSYS2.TABLES and SYSIBM.TABLES catalog views but does not have any privilege to a table called WORK.EMPLOYEE. The following SQL statement will not return a result row:
SELECT * FROM QSYS2.TABLES WHERE TABLE_SCHEMA = 'WORK' AND TABLE_NAME = 'EMPLOYEE'
However, the following SQL statement will return a result row:
SELECT * FROM SYSIBM.TABLES WHERE TABLE_SCHEMA = 'WORK' AND TABLE_NAME = 'EMPLOYEE'