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

Thread: foreign/primary keys

Hybrid View

  1. #1
    Join Date
    Jan 2001
    Posts
    10

    Angry

    How do I find out whether a primary key is referencing a foreign key in another table &, if so, which table is being referenced?

    I need to do some index rebuilding & Oracle won't let me disable the contraint because it is referenced elsewhere in the database.

    There seems v. little documentation in this area & I have no idea which dictionary tables to query.

    cheers.


  2. #2
    Join Date
    Feb 2001
    Posts
    123
    This might be what you are looking for:

    select c.owner, c.constraint_name, c.constraint_type,
    c.table_name
    from dba_constraints c
    where c.r_owner = 'owner of your constraint'
    and c.r_constraint_name = 'name of your constraint';

    HTH

    David.

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