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: <doid_at_my-deja.com>
Date: Thu, 11 Jan 2001 17:52:57 GMT
Message-ID: <93krtk$emt$1@nnrp1.deja.com>

I think your query will only show the tables referenced by the table you specify.

If you want to find foreign keys which reference your table, try this:

SELECT  child.owner,
        child.table_name,
        child.constraint_name
FROM    dba_constraints child,
        dba_constraints parent
WHERE   child.r_constraint_name = parent.constraint_name
AND     parent.table_name = UPPER('&&parent')


In article <93il3d$in9$1_at_nnrp1.deja.com>,   jumaga_at_my-deja.com wrote:
> drop table <tablename> cascade constraints;
> will drop the table regardless of any foreign key constraints.
>
> Alternatively:
> select * from dba_constraints
> where table_name = <tablename>
> and constraint_type = 'R';
>
> In article <93ik5h$hod$1_at_nnrp1.deja.com>,
> vdolt_at_my-deja.com wrote:
> > 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/
> >
>
> Sent via Deja.com
> http://www.deja.com/
>

Sent via Deja.com
http://www.deja.com/ Received on Thu Jan 11 2001 - 11:52:57 CST

Original text of this message

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