主外键约束信息
[作者]:菩提树下的杨过 [来源]:互联网 [收录时间]:2007-7-29 21:38:04

Copy from The Oracle (tm) Users' Co-Operative FAQ

-- Parent / Child / Key Reference --

set pages 50000
set feedback off
spool constraint.log

col parent format a27
col child format a27
col key format a21

select a.table_name Parent,
b.table_name Child,
column_name Key,
substr(position,1,1) P
from
user_constraints a, user_constraints b, user_cons_columns c
where
a.constraint_name = b.r_constraint_name
and a.constraint_name = c.constraint_name
order by 1, 2, 4;

spool off