Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help !: How can I drop a column in a table?
Hi Dani,
You can only drop a column on 8i or above.
Assuming you're on 8i or above you can either:
ALTER TABLE bowie SET UNUSED COLUMN ziggy
to drop the column "immediately". The data is still physically in the data blocks but the DD has been updated to effectively remove the column.
or
ALTER TABLE bowie DROP COLUMN ziggy
to drop the column "slowly". The data will be removed as part of the dropping process. This will also remove the data from any previously set unused columns.
ALTER TABLE bowie DROP UNUSED COLUMNS
will remove the data from the previously set used columns.
There are various other options you can use, particularly if the table you're manipulating is large and much rollback is going to be generated.
All of this is in the SQL reference manual by the way (hint hint).
Good Luck
Richard
"dani" <drezusta_at_airtel.net> wrote in message
news:ahj2k7$9ad$1_at_nsnmrro2-gest.nuria.telefonica-data.net...
> Hi,
> I got a problem, I don't know what it's the correct syntax to eliminate a
> column in a table.
> I've tried with : "ALTER TABLE t DROP COLUMN c", but doesn't work
>
> Any idea ?
>
> thanks
>
>
> Dani
>
>
Received on Tue Jul 23 2002 - 03:20:06 CDT