Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I get a list of referenced keys?
On Fri, 12 Jun 1998 20:19:14 GMT, - haven -
<haven_at_havenskys.com> wrote:
>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
Try the following:
select dc.table_name, dc.constraint_name from dba_constraints dc, dba_constraints drc where drc.owner='SQLPLUS' and drc.table_name = 'EMPLOYEE' and dc.constraint_type ='R' and dc.r_owner = drc.owner and dc.r_constraint_name = drc.constraint_name;
It will give you a list of tables and constraints that refer to SQLPLUS.EMPLOYEE. Of course you should substitute your own table name.
Happy hunting.
Jonathan Received on Fri Jun 12 1998 - 22:10:03 CDT