Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Renaming Columns -- How?
Is there a way to rename table columns?
I've done the following to rename a column while preserving all the old table data:
create table temp_tablename as
select * from tablename
/
drop table tablename
/
create tablename ( <newcolumns-with-new-names> )
/
create indexes, permissions, etc.
/
insert into tablename ( <newcolumns-list> )
select <oldcolumns-list>
from temp_tablename
/
The very first statement fails for one of our tables because one of the columns is of LONG datatype.
Is there a simple, single command for renaming a column?
Thanks in advance.
(Apologies for anti-spam addressing: see Org line for domain info.) Received on Wed Mar 18 1998 - 00:00:00 CST