Oracle查找表的外键引用关系 

select t1.table_name, 
       t2.table_name as "TABLE_NAME(R)", 
       t1.constraint_name, 
       t1.r_constraint_name as "CONSTRAINT_NAME(R)",
       a1.column_name, 
       a2.column_name as "COLUMN_NAME(R)"
from user_constraints t1, user_constraints t2, user_cons_columns a1, user_cons_columns a2 
where t1.owner = upper('DCI') and 
      t1.r_constraint_name = t2.constraint_name and 
      t1.constraint_name = a1.constraint_name and 
      t1.r_constraint_name = a2.constraint_name;
DCI是用户名称


查看被视图或者触发器、存储过程使用过:
select * from user_dependencies t where t.referenced_name = 'TABLE_NAME';

  

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-09-22
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
猜你喜欢
  • 2021-07-27
  • 2021-09-17
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-09-25
相关资源
相似解决方案