Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Foreign keys.

Re: Foreign keys.

From: Jon Walthour <jwalthour_at_mac.com>
Date: Mon, 15 Jan 2001 20:33:09 -0500
Message-ID: <B6890F05.546F%jwalthour@mac.com>

on 1/10/01 4:28 PM, vdolt_at_my-deja.com at vdolt_at_my-deja.com wrote:

> Message from the Deja.com forum:
> comp.databases.oracle.server
> Your subscription is set to individual email delivery
> This message was sent to jwalthour_at_mac.com
> Deja.com: Best way to buy a PC
> http://www.deja.com/channels/channel.xp?CID=13031

>> 

> Is there a way to find out all the foreign keys pointing to specific
> table? I am trying to drop it, and referential integrity won't let me.
> Thanks.
>
>
> Sent via Deja.com
> http://www.deja.com/
>
>
>
> _____________________________________________________________
> Deja.com: Before you buy.
> http://www.deja.com/
> * To modify or remove your subscription, go to
> http://www.deja.com/edit_sub.xp?group=comp.databases.oracle.server
> * Read this thread at
> http://www.deja.com/thread/%3C93ik5h%24hod%241%40nnrp1.deja.com%3E
>

Try this script:
select b.table_name
     , b.constraint_name as foreign_key
     , a.constraint_name as primary_key
     , a.table_name as referenced_table

from dba_constraints a

   , dba_constraints b
where a.constraint_name=b.r_constraint_name and b.table_name='<X>'

(replace <X> with the name of the table you want to know about.

Hopt this helps,

-- 

Jon Walthour, BSCD
Oracle 8i Certified Database Administrator
marchFIRST (http://www.marchFIRST.com)
Cincinnati, Ohio 



 Sent via Deja.com http://www.deja.com/
 Before you buy.
Received on Mon Jan 15 2001 - 19:33:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US