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: How can I get a list of referenced keys?

Re: How can I get a list of referenced keys?

From: Greg Parsons <parsons_at_inmet.com>
Date: Fri, 12 Jun 1998 21:22:19 GMT
Message-ID: <35819C0B.83DFEF62@inmet.com>


Hi,

    You'll need dba for this (or you may be able to do this with the user_ or all_ table - with associated change of scope) but try,

        select owner, constraint_name, table_name,
                  r_owner, r_constraint_name, status
           from dba_constraints
           where r_constraint_name in (select constraint_name
                                                         from
dba_constraints
                                                         where
constraint_type = 'P'
                                                              and table_name
= 'emp_head');

    There may be more efficient manners...     Anyway, read down the list for a status of enabled - these are the ones that are still true - foreign keys preventing a the table from being dropped. You need to disable these references from the foreign key tables listed.
HTH,
    Greg

> I need to get drop this table. How can I get a list of referenced keys?
>
> So that I can drop it. I disabled all constraints that refer to it but
> no dice.
> Thanks
>
> Haven
>
> SQL> drop table emp_head;
> drop table emp_head
> *
> ERROR at line 1:
> ORA-02266: unique/primary keys in table referenced by enabled foreign
> keys
Received on Fri Jun 12 1998 - 16:22:19 CDT

Original text of this message

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