当前位置导航:炫浪网>>网络学院>>编程开发>>Oracle教程

主外键约束信息

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

相关内容
赞助商链接