2/01/2012

How to get list of all parent child relation in the database

السلام عليكم

 Parent -Childيمكنك هذا الكود من استعراض العلاقات بين الجداول فى حاله ال 







SELECT a.table_name,
       a.constraint_name pkey_constraint,
       b.constraint_name fkey_constraint,
       b.r_constraint_name
FROM   user_constraints a, user_constraints b
WHERE  a.table_name = b.table_name
AND    a.constraint_type = 'P'
AND    b.constraint_type = 'R'
AND    a.constraint_name != b.r_constraint_name




-->

No comments:

Post a Comment