Re: How can I drop a column from a table?
Date: 1996/07/30
Message-ID: <4tkp8d$ec7_at_castle.nando.net>#1/1
M Rajeshwar <MR1154_at_CAMBER.COM> wrote:
>Jarmo Tuominen wrote:
>>
>> What is the best way to drop a column from the table? Is there any command for this?
>>
>> Jarmo Tuominen
>You cannot drop a column. SQL*Plus does not give a option to do this.
>But this can be achieved in the followin way.
>Assume you have a table TABLE with columns c1,c2 and c3, and that you
>want to delete column c2.
>Create a temporary table temptab as
> CREATE TABLE TEMPTAB AS SELECT C1,C3 FROM TAB;
>Drop the original table TABLE as, DROP TABLE TABLE;
>Rename this temporary table back to its original as,
> RENAME TEMPTAB TO TABLE;
>So, that will leave the table TABLE with one column deleted !!!
>Any other suggestions are highly welcome.
>Raj
Remember...the modified table is a NEW database object. If you have
any access permissions etc. you will need to explicitly assign them to
the new table.
Ken
Received on Tue Jul 30 1996 - 00:00:00 CEST