您当前的位置:数据库学习网SQL数据库教程 → 文章内容

主外键约束信息

作者:佚名  来源:不详  发布时间:2008-11-21 8:07:21
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 a21select 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