If I have a table "Person", with a primary key 'ID', how can I see a list of tables with foreign keys that points to the "ID" column in the "Person" table?
Asked
Active
Viewed 334 times
1 Answers
2
Use the ALL_CONSTRAINTS system view.
select table_name
from all_constraints
where r_owner = 'OWNER'
and r_constraint_name = 'YOUR_PRIMARY_KEY'
R_OWNER is the owner of the primary key and R_CONSTRAINT_NAME is the name of the primary key.
Ben
- 50,172
- 36
- 122
- 141