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

Re: how to remove "on delete cascade" constraint clause?

From: <mark.powell_at_eds.com>
Date: 17 Oct 2002 15:36:43 GMT
Message-ID: <aomleb$m72$1@news.netmar.com>


In article <423b5ab1.0210161551.236169d7_at_posting.google.com>, Sharkie <sharkdba_at_yahoo.com> writes:
>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".

I think after checking the 8.1 SQL manual constrain clause syntax that your only option is to drop and re-create the FK. To save time you could perform the re-create using the novalidate option.

HTH -- Mark D Powell --

Received on Thu Oct 17 2002 - 10:36:43 CDT

Original text of this message

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