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 to drop a foreign key

Re: How to drop a foreign key

From: Klaus Zeuch <KZeuchnospam_at_hotmail.com>
Date: Wed, 11 Apr 2001 09:22:18 +0200
Message-ID: <9b14d2$tlt$1@papyrus.erlm.siemens.de>

To retrieve the name of the constraint:

select owner, table_name, constraint_name, constraint_type from user_constraints
where table_name = 'A' and constraint_type = 'R' /* r = referential key */;

With the constraint_name retrieved to drop the constraint:

alter table A drop constraint constraint_name;

to disable/enable a constraint:

alter table A modify constraint constraint_name enable|disable;

Klaus

David YEUNG <dyeung_at_ust.hk> schrieb in im Newsbeitrag: 3AD3D84A.27B789E1_at_ust.hk...
> I have a table A which contains a foreign key reference to
> table B's primary key, e.g.:
>
> create table A (
> ...
> fid varchar2(16) not null,
> ...
> foreign key (fid) references B(pid) on delete cascade
> )
>
> where pid is the primary key of the table B.
>
> Can someone tell me how to drop (or disable) the foreign key in table A.
>
> Thanks
>
> david
Received on Wed Apr 11 2001 - 02:22:18 CDT

Original text of this message

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