Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Change Field Name - Urgent!
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 DardReceived on Thu Aug 03 2000 - 00:00:00 CDT