How can I find both reference tables and referencial tables in Oracle SQL Developer using a simple script
Asked
Active
Viewed 242 times
0
-
You could use INFORMATION_SCHEMA views. – Eugene Podskal Jun 26 '14 at 13:14
-
@EugenePodskal INFORMATION_SCHEMA is in PostgreSQL. Oracle stores static metadata in user_, all_, dba_ views and dynamic metadata in V$ – neshkeev Jun 26 '14 at 13:30
-
As I know, INFORMATION_SCHEMA has been obsolete already. – neshkeev Jun 26 '14 at 13:34
-
Thank you for the info. I just thought that most of SQL-compliant DBMS provide it. – Eugene Podskal Jun 26 '14 at 13:35
-
You can query from dictionary to see the whole data dictionary `select * from dictionary` – neshkeev Jun 26 '14 at 13:39
1 Answers
0
In case you mean foreign key constraints, you can use the following query:
select a.table_name "PARENT", b.table_name "CHILD"
from user_constraints a, user_constraints b
where a.constraint_type = 'P'
and b.constraint_type = 'R'
and a.constraint_name = b.r_constraint_name;

Erich Kitzmueller
- 36,381
- 5
- 80
- 102