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 -> how to remove "on delete cascade" constraint clause?

how to remove "on delete cascade" constraint clause?

From: Sharkie <sharkdba_at_yahoo.com>
Date: 16 Oct 2002 16:51:10 -0700
Message-ID: <423b5ab1.0210161551.236169d7@posting.google.com>


This seems like a simple task, but anywhere I look, I see syntax on how to add "on delete cascade" to a foreign key constraint. However, how do I remove it without dropping and recreating the constraint?

I tried:

alter table <table2_name> modify (<col2_name> constraint <constraint_name> foreign key references <table1_name> (<column1_name>))

[without the "on cascade delete"]

but get this error:
ORA-02253: constraint specification not allowed here

An example:
create table temp1 (temp1intid int primary key, tempname1 varchar2(100)); create table temp2 (temp2intid int, tempname2 varchar2(100)); alter table temp2 add constraint fk_temp2_01 foreign key (temp2intid) references temp1 (temp1intid) on delete cascade;

now, I'd like to keep the fk_temp2_01 foreign key, but remove the "on delete cascade". Received on Wed Oct 16 2002 - 18:51:10 CDT

Original text of this message

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