select * from user_cons_columns cl where cl.table_name = 'A' and cl.column_name = '外键名'
-- 查询被指定表引用的父表 select c.owner||'.'||c.table_name child_table, c.constraint_name, r.owner||'.'||r.table_name parent_table from dba_constraints c,dba_constraints r where c.owner=r.r_owner and c.constraint_name=r.r_constraint_name and c.owner=upper('&child_owner') and c.table_name=upper('&child_table');-- 查询引用指定表的子表 select c.owner||'.'||c.table_name child_table, c.constraint_name, r.owner||'.'||r.table_name parent_table from dba_constraints c,dba_constraints r where c.owner=r.r_owner and c.constraint_name=r.r_constraint_name and r.owner=upper('&parent_owner') and r.table_name=upper('&parent_table');
-- 查询被指定表引用的父表
select
c.owner||'.'||c.table_name child_table,
c.constraint_name,
r.owner||'.'||r.table_name parent_table
from dba_constraints c,dba_constraints r
where c.owner=r.r_owner and c.constraint_name=r.r_constraint_name
and c.owner=upper('&child_owner') and c.table_name=upper('&child_table');-- 查询引用指定表的子表
select
c.owner||'.'||c.table_name child_table,
c.constraint_name,
r.owner||'.'||r.table_name parent_table
from dba_constraints c,dba_constraints r
where c.owner=r.r_owner and c.constraint_name=r.r_constraint_name
and r.owner=upper('&parent_owner') and r.table_name=upper('&parent_table');