Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何在Oracle中查看DB表上的外键关系_Sql_Database_Oracle - Fatal编程技术网

Sql 如何在Oracle中查看DB表上的外键关系

Sql 如何在Oracle中查看DB表上的外键关系,sql,database,oracle,Sql,Database,Oracle,我知道,为了查看表的唯一性,您可以使用以下内容 set serveroutput on; BEGIN <DB name>.show_uniqueness('BILL_BASE.<Table name>'); END; 打开服务器输出; 开始 .显示唯一性(“BILL_BASE”); 结束; 这将为您提供要修改的表上的所有唯一约束 我的问题是如何查看与表关联的所有外键。是否有类似于上面的查询,我可以用来查看此类信息您可以查询用户约束视图以列出表上定义的所有约束。

我知道,为了查看表的唯一性,您可以使用以下内容

set serveroutput on;
BEGIN
    <DB name>.show_uniqueness('BILL_BASE.<Table name>');
END;
打开服务器输出;
开始
.显示唯一性(“BILL_BASE”);
结束;
这将为您提供要修改的表上的所有唯一约束


我的问题是如何查看与表关联的所有外键。是否有类似于上面的查询,我可以用来查看此类信息

您可以查询用户约束视图以列出表上定义的所有约束。外键约束的类型为R:

select constraint_name
      ,table_name
  from user_constraints
 where constraint_type = 'R'
列R_CONSTRAINT_NAME将为您提供另一个表的主键约束。使用相同的视图(但现在用于PK约束)将为您提供有关相关表的信息