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:
tuinstoel
2009-05-29 15:00:04
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
2009-05-29 15:05:13
I only wanted to help you.
tuinstoel
2009-05-29 15:27:15
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
2009-05-29 15:38:52
+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
2009-05-29 15:21:58
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
2009-05-29 15:30:47
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
2009-05-29 15:41:43