Hi,
The SQL below lists all the tables with primary & foreign key relationships.
select ptabid TABID,
substr((select tabname from systables where tabid=ptabid),1,18) PRIMARY,
tabname[1,18] FOREIGN,
constrname[1,18] IDXNAME,
decode(delrule,'C','Yes','No') CASCADE
from
sysconstraints c, sysreferences r, systables s
where
c.constrtype='R' and c.constrid=r.constrid and c.tabid=s.tabid and
ptabid in
(select tabid from sysconstraints where constrtype in ('P','U'))
order by 1;
Regards,
Shriyan