database 有没有办法在 Oracle SQL Developer 中查看关系?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/926437/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 07:19:52  来源:igfitidea点击:

Is there a way to view relationships in Oracle SQL Developer?

databaseoracle

提问by uriDium

I want to find which tables are related to a specific table. I can see all the foreign key constraints easily enough, but what about table for which the table I am looking at is the primary key table and the other table is the referenced table.

我想查找哪些表与特定表相关。我可以很容易地看到所有的外键约束,但是我正在查看的表是主键表而另一个表是被引用表的表呢?

回答by jcadcell

Steps in SQL Developer

SQL Developer 中的步骤

  • go to View> Data Modeler> Browserto open up the Browserview/tab.
  • (Browserview/tab*) right click on Relational Modelsand select New Relational Modelwhich opens up a new window.
  • 转到View> Data Modeler>Browser打开Browser视图/选项卡。
  • ( Browserview/tab*) 右键单击Relational Models并选择New Relational Model打开一个新窗口。

This should create a new blank diagram which one can drag and drop tables from the Connectionsview into the diagram.

这应该创建一个新的空白图表,可以将表格从Connections视图拖放到图表中。

回答by dpbradley

It's not clear if you're looking for a GUI solution, but you can query the information from the dictionary by:

不清楚您是否正在寻找 GUI 解决方案,但您可以通过以下方式从字典中查询信息:

select table_name from user_constraints
where r_constraint_name in
  (select constraint_name 
     from user_constraints
     where constraint_type in ('P','U')
     and table_name = upper('&tableOfInterest')
  ) 

回答by tuinstoel