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: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: Sat, 13 Jun 1998 03:10:03 GMT
Message-ID: <6lsqi0$nvt@bgtnsc03.worldnet.att.net>


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

Original text of this message

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