DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Find primary key with matching foreign key

  1. #1
    Join Date
    Mar 2001
    Posts
    77
    I need to find out which primary key doesn't have a matching foreign key in the database. I think it has something to do with the data dictionary.

    Anyone has any ideas? Thanks!


  2. #2
    Join Date
    Apr 2001
    Posts
    37
    select owner, constraint_name
    from dba_constraints
    where constraint_type = 'P'
    and (owner, constraint_name) not in
    (select r_owner,r_constraint_name
    from dba_constraints
    where constraint_type = 'R');
    inosov
    Brainbench MVP for Oracle DBA

  3. #3
    Join Date
    Mar 2001
    Posts
    77
    Thank you!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width