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: Change Field Name - Urgent!

Re: Change Field Name - Urgent!

From: Christophe Galerne <christophe_at_tumbleweed.com>
Date: 2000/08/03
Message-ID: <398A30CF.92DFB230@tumbleweed.com>#1/1

Yong wrote:
>
> No. It's much more complicated than you think. Even though the latest Oracle
> version gives you drop column (as many DBAs have expected for years), it
> still doesn't allow you to alter table rename column.
>
> If your table has no constraint or other dependants, you can simply:
> create table mytabbak as select * from mytab;
> drop table mytab;
> create table mytab [with new column definitions];
> insert into mytab select * from mytabbak;
> drop table mytabbak;

It seems that there is an optimization to what you suggest which would be to create the new column directly to the existing table. ALTER TABLE "MyTable" ADD(EXTRACOLUMN VARCHAR2(10) NULL);

Then update the new column with the old one.

Is a possible solution?

Christophe

Christophe L. Galerne                       cgalerne_at_tumbleweed.com
Software Engineer                               Tel: (650) 216 2029
"Nos gueules de bois se dissipent en 24 heures, pas nos conneries."
                                                    - Frederic Dard
Received on Thu Aug 03 2000 - 00:00:00 CDT

Original text of this message

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