Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Drop constraints CASCADE not working on 10g Express
QDL schrieb:
> Hello everyone,
>
> I have a problem with a table which has a primary key. I want to delete this
> primary key in order to be able to create a different one. In Oracle 9i I
> used to issue:
>
> ALTER TABLE xxx DROP CONSTRAINT "PK_XXX" CASCADE;
>
> and I deleted BOTH the constraint AND the primary key.
>
> If i issue that command on my Oracle 10g Express, the constraint is deleted
> but PK_XXX is still there preventing me to create a new one with the same
> name...
>
> Is this a problem with 10g Express, something has changed in the way CASCADE
> works?
>
> Thanx in Advance
> Paolo
>
>
Paolo, CASCADE keyword is/was not related to the index retaining/dropping of primary key. To drop/retain index you have to specify DROP INDEX or KEEP INDEX, you can look it up http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2103845 I believe, it was discussed here some time ago about changed behaviour from 9i to 10g (in 9i default was DROP INDEX, in 10g - the opposite iirc).
Best regards
Maxim Received on Fri Nov 24 2006 - 09:16:47 CST