Oracle – How to get all tables that have FKs to another table

foreign-keysoracle

Is there any way to get all tables that have foreign keys to another table in oracle with a query?

Best Solution

Here is a good article with an answer:

select owner,constraint_name,constraint_type,table_name,r_owner,r_constraint_name
from all_constraints 
where constraint_type='R'
and r_constraint_name in (select constraint_name from all_constraints 
where constraint_type in ('P','U') and table_name='TABLE_NAME');