News
Perth, Australia
+ (61) 417713124
prosolutions@gavinsoorma.com

Check for dependant foreign keys before dropping Primary Key

  • Posted by Gavin Soorma
  • On June 18, 2009
  • 0 Comments

SELECT A.owner foreign_owner, a.table_name foreign_table, b.owner primary_owner, b.table_name primary_table
from dba_constraints a, dba_constraints b
where a.r_constraint_name = b.constraint_name and a.constraint_type = 'R'
and b.constraint_type = 'P' and b.table_name = 'DEPT';

 

0 Comments

Leave Reply

Your email address will not be published. Required fields are marked *