next up previous
Next: Security and Sharing Up: ADDITIONAL FEATURES OF SQL Previous: Triggers

Catalog

systables
  tabname char(18)
  tabid integer
  owner char(8)
  ncols smallint
  nrows integer
  created date
  tabtype char(1) ; T = table, V = view

sysusers
  username char(8)
  usertype char(1) ; D = DBA, R = resource, C = connect

syscolumns
  colname char(18)
  tabid integer
  colno smallint
  coltype smallint ; 0 = CHAR, 1 = SMALLINT, ...

select tabname, tabid 
from systables 
where owner = 'RAJ';

select colname 
from syscolumns 
where tabid in (select tabid 
                from systables 
                where tabname = 'customers');

Other Useful Commands:

INFO TABLES
  lists all tables owned by you

INFO COLUMNS FOR customers
  lists all columns for customer table

INFO INDEXES FOR customers
  lists all indexes for customers table

INFO STATUS FOR customers
  lists status info for customers table 
  (owner, no. of rows, no. of columns, 
   date created etc.)



Raj Sunderraman
Tue Apr 1 16:15:10 PST 1997