Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Renaming Columns -- How?
On 18 Mar 1998 19:13:59 GMT, "Tay Ninh Brown" <tay_at_NO.JUNK> wrote:
>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.)
As far as I know there isn't. As for your problems with the LONG datatype: You could use the SQL*Plus COPY command. This doesn't copy the entire LONG field, but only the first 32 K if I remember correctly. Perhaps this is good enough??
I hope this is a usefull tip. Let me know if it works.
Paul. Received on Wed Mar 18 1998 - 00:00:00 CST