To find reference table of a table in oracle

To find reference table of a table in oracle
select table_name, constraint_name, status, owner
from all_constraints
where r_owner = 'MAP'
and 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'
   and owner = 'MAP'
 )
order by table_name, constraint_name


Reactions

Post a Comment

0 Comments