Search This Blog

Wednesday, December 16, 2009

How to find which tables have FK bases on PK parent table

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