views:

417

answers:

2

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.

A: 

Data modeling: http://www.oracle.com/technology/products/database/sql_developer/files/Modeling.html

tuinstoel
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 only wanted to help you.
tuinstoel
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
+2  A: 

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
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
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