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.
Asked
Active
Viewed 6.1k times
3 Answers
19
Steps in SQL Developer
- go to
View
>Data Modeler
>Browser
to open up theBrowser
view/tab. - (
Browser
view/tab*) right click onRelational Models
and selectNew Relational Model
which 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.
-
3Also, 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. – lealceldeiro Jan 09 '18 at 16:17
-
wow, all that effort to click just on the "Model tab" when opening a table ^^ – karlihnos May 03 '19 at 10:22
-
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 / table – ACV Sep 22 '20 at 11:23
16
It'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')
)

dpbradley
- 11,645
- 31
- 34
-
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 – uriDium May 29 '09 at 15:30
-
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). – dpbradley May 29 '09 at 15:41
-
1You could also replace `user_constraints` with `all_constraints` to check for relationships. – Jed Schaaf Mar 20 '16 at 02:03
2
See Oracle SQL Developer Data Modeler: http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html

user5994461
- 5,301
- 1
- 36
- 57

tuinstoel
- 7,248
- 27
- 27
-
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 May 29 '09 at 15:05
-
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 :) – uriDium May 29 '09 at 15:38
-
@tuinstoel i am getting page not found, that is probably expected bc it has been 7 years. any chance to update the link? – Rami Alshareef Nov 01 '16 at 19:18
-
@RamiShareef Try this url: https://web.archive.org/web/20081202130146/http://www.oracle.com/technology/products/database/sql_developer/files/Modeling.html ,you may also find more helpful answers [here](http://stackoverflow.com/questions/6580529/how-to-generate-an-entity-relationship-er-diagram-using-oracle-sql-developer). – faghani Nov 16 '16 at 05:55