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.
3 Answers
Steps in SQL Developer
- go to
View>Data Modeler>Browserto open up theBrowserview/tab. - (
Browserview/tab*) right click onRelational Modelsand selectNew Relational Modelwhich opens up a new window.
This should create a new blank diagram which one can drag and drop tables from the Connections view into the diagram.
3 Comments
lealceldeiro
Also, if you click a table, and select "Model", the SQL Developer will generate the part of the (whole) model which is related to this table.
karlihnos
wow, all that effort to click just on the "Model tab" when opening a table ^^
ACV
This doesn't show the relations between tables. It shows the tables / views, but doesn't show me the references which I can see on the
Dependencies tab for a specific view / tableIt's not clear if you're looking for a GUI solution, but you can query the information from the dictionary by:
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')
)
3 Comments
uriDium
I was hoping for a GUI type option so that I can just click a button and it will list them. BUT I can make do with this if no one else comes along. Thanks
dpbradley
There is a product, PL/SQL Developer by Allround Automations that includes this in their GUI interface - they have both "foreign keys" and "foreign key references" branches in their navigation tree for a table node. Disadvantages - not free, native to Windows (but will run in Linux under Wine).
Jed Schaaf
You could also replace
user_constraints with all_constraints to check for relationships.See Oracle SQL Developer Data Modeler: http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html
4 Comments
uriDium
I was scared someone would say this. Something extra to install and get working. Is there nothing standard? Also, from what I read, it will only give you an EDR from the tables you select. The problem is that I don't which tables might be referencing the table I am looking at and that is what I want to know.
uriDium
I know thanks. I am just trying to clarify what I am looking for. Sorry if I gave you the wrong impression. I am just reluctant for a built-in feature. Was hoping that there was one. Thanks for the suggestion though :)
Rami Alshareef
@tuinstoel i am getting page not found, that is probably expected bc it has been 7 years. any chance to update the link?
faghani
@RamiShareef Try this url: web.archive.org/web/20081202130146/http://www.oracle.com/… ,you may also find more helpful answers here.