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: Yong <yhuang_at_indigopool.com>
Date: 2000/08/04
Message-ID: <8mel80$82a$1@news.sinet.slb.com>#1/1

The side effect of that is if somebody's code is like:

insert into newtable select * from mytab; instead of
insert into newtable (col1, col2) select col1, col2 from mytab;

or

in ASP Web programming he uses Fields[i] (can't remember the syntax), then the code will break. I.e., if the code relies on the order of the columns in the table mytab, your method is bad.

Yong Huang
yhuang_at_indigopool.com

Christophe Galerne <christophe_at_tumbleweed.com> wrote in message news:398A30CF.92DFB230_at_tumbleweed.com...
> 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 Fri Aug 04 2000 - 00:00:00 CDT

Original text of this message

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