Catalogs in database design
A catalog is automatically created when you create a schema. There is also a system-wide catalog that is always in the QSYS2 library.
When an SQL object is created in a schema, information is added to both the system catalog tables and the schema's catalog tables. When an SQL object is created in a library, only the QSYS2 catalog is updated. A table created with DECLARE GLOBAL TEMPORARY TABLE is not added to a catalog.
As the following examples show, you can display catalog information. You cannot insert, delete, or update catalog information. You must have SELECT privileges on the catalog views to run the following examples.
- Getting catalog information about a table
The SYSTABLES view contains a row for each table and view in the SQL schema. The SYSTABLES view provides information such as the object type (table or view), the object name, the owner of the object, and the schema where the object exists.
- Getting catalog information about a column
The SYSCOLUMNS view contains a row for each column of a table and view in the schema.
Parent topic:
Data definition language
Related reference
DB2 UDB for iSeries catalog views