Re: EASY? Drop a column in a table.

From: Renu P. Gurudev <prasad_at_dcplhs.enet.dec.com>
Date: 7 JUL 94 18:19:13
Message-ID: <2vhvcm$e2r_at_nntpd.lkg.dec.com>


In article <ep3g6300004_at_novalink.com>, bmay_at_novalink.com (Brett M May) writes...
>>
>> I'm somewhat new at this. I tried to drop the column APPL_ID in
>> a table called PERSON in Oracle 7. I tried:
>>
>> alter table PERSON drop (APPL_ID)
>>
>> but was told I was missing an expression.
>> I figure either this is very easy to do, or it can't be done.
>> HELP!
>> Anil Rhemtulla
>>
>
>Anil, I hate to be bearer of ill news and such, but you can't drop a
>column from a table in any version of oracle that I've seen. You can
>add a column to a table, or modify it by changing its length, but you
>can't drop it.
>Your only recourse is to drop the entire table and recreate it minus the
>offending column.
>
>Cheers,
>Brett
>
>
>-----------------------------------------------------------------
>Brett M. May |"...so I says to the lama, 'HEY! LAMA! How
>Andersen Consulting |bout a little something for the effort?'
>Houston, TX |And the lama says, 'oh, there will be no
>(713) 237-2206 (day) |money. But when you die, on your deathbed,
>bmay_at_novalink.com |you will recieve total conciousness.' So I
> |got that going for me, which is nice..."
>-----------------------------------------------------------------

Since you need to work around for dropping the table and then creating a new one without the column, use the 'create table ...as select' syntax to create a new table without the column (use only the columns you want in the new table when you are specifying the SELECT statement). If other netters have better suggestions you are welcome.

Renu Prasad Received on Thu Jul 07 1994 - 18:19:13 CEST

Original text of this message