Appendix D: System Catalog Tables
Overview
The Dharma DataLink SDK maintains a set of system tables for storing information about table spaces, tables, columns, indexes, constraints, and privileges. These tables are called system catalog or dictionary tables.
SQL data definition statements and GRANT and REVOKE statements update system catalog tables. Users have read access to the system catalog tables. The database administrator has update access to the tables, but should avoid modifying them directly.
There are two types of tables in the system catalog: base tables and extended tables. Base tables store the information on the table spaces, tables, columns, and indexes that make up the database. The extended tables contain information on constraints, privileges, and statistical information.
The owner of the system tables is dharma. If you connect to a Dharma environment with a User ID other than dharma, you need to qualify references to the tables in SQL queries. For example:
SELECT * FROM DHARMA.SYSTABLES
Table D–1 shows details of the columns in each system table. Here is the SQL query that generated the data for Table D–1. You can modify it to generate a similar list that includes user-created tables by omitting the line and st.tbltype = 'S'.
select sc.tbl 'Table', sc.col 'Column', sc.coltype 'Data Type', sc.width 'Size' from systpe.syscolumns sc, systpe.systables st where sc.tbl = st.tbl and st.tbltype = 'S' order by sc.tbl, sc.id