Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL: DELETE and DROP TABLE with cascading ?
On Feb 25, 11:38 am, clau..._at_wonderworld.com (Claudia d'Amato) wrote:
> As far as I found out DELETE and DROP TABLE are NOT possible with some kind of
> additional cascading instruction.
>
> DELETE CASCADE
> FROM mytable
> WHERE ....
>
> is not possible.
> Same with:
>
> DROP TABLE mytable CASCADE
>
> The only way I found so far is that I have to specify a clause
> "ON DELETE CASCADE" at the time when the table(s) were created.
>
> Is this really true?
Well you can apply this constraint later using ALTER TABLE command.
>
> Is there no work around to pass an explicitly "get rid aff the whole table structure/records"
> at the time of deletion regardless of wether an ON DELETE CASCADE is specified before or not ?
>
> Claudia
Now this is a different question. What do you really mean when you ask
to
"get rid aff the whole table structure/records" ?
Even you quoted it, so you are unclear about it as well?
Do you have a datamodel which would support cascaded deletes? (Primary keys and Foreign Keys defined correctly for all the child tables?) Good planning solves a host of problems.
Ed Received on Mon Feb 26 2007 - 14:00:42 CST