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: Can Oracle drop a column?

Re: Can Oracle drop a column?

From: Fuzzy <granta_at_student.canberra.edu.au>
Date: 1997/05/26
Message-ID: <33891318.20420467@newshost.interact.net.au>#1/1

On 25 May 1997 05:03:50 GMT, "Yao Fang" <fangyao_at_worldnet.att.net> wrote:

>Hi there :
> The table has about 1m of data. I want to drop a column of that table.
>It seems like Oracle doesn't allow me to do that. When I use ALTER TABLE
>command. The only thing I can drop is the constraints. Some may suggest to
>create a temporary table, then use INSERT to transfer the data.(It takes
>some time) Is there any other ways?
>TIA
>
>Kathy Fangyao

Nope. Dropping a column is not standard SQL, for some good reasons I won't go into.

Try CREATE TEMPTABLE AS SELECT <THE COLUMNS YOU WANT> FROM OLDTABLE, then DROP OLDTABLE
then RENAME TEMPTABLE TO OLDTABLE.

Ciao
Fuzzy
:-) Received on Mon May 26 1997 - 00:00:00 CDT

Original text of this message

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