user catalog TABLE NAME TABLE TYPE STUDENTS TABLE INSTRUCTORS TABLE COURSES TABLE GRADES TABLE ADVISING TABLE
select stno name addr city state zip from GRADUATES
5.24 Accessing metadata in SQLPlus
The catalog of ORACLE is a very large tabular variable that can be accessed through several views defined on this table. In ORACLE a list of the table owned by the current user is contained by the view user catalog, also accessible through its synonym cat. A content of this view is shown in Figure 5.24. Information that describes space allocation and statistical properties can be found in the view named USER TABLES, also named TABS. A description of the attributes of tabular variables and of their domains can be found in the view USER TAB COLUMNS also accessible as COLS. For example, the query:
select table_name,column_name,data_type from COLS;
results in the following table:
TABLE_NAME COLUMN_NAME DATA_TYPE ADVISING STNO CHAR ADVISING EMPNO CHAR COURSES CNO CHAR COURSES CNAME CHAR COURSES CR NUMBER GRADES STNO CHAR GRADES EMPNO CHAR GRADES CNO CHAR GRADES SEM CHAR GRADES YEAR NUMBER GRADES GRADE NUMBER INSTRUCTORS EMPNO CHAR INSTRUCTORS NAME CHAR INSTRUCTORS RANK CHAR INSTRUCTORS ROOMNO NUMBER INSTRUCTORS TELNO CHAR STUDENTS STNO CHAR STUDENTS NAME CHAR