Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: rename a column

Re: rename a column

From: Beth Katcher <b.katcher_at_rcn.com>
Date: Thu, 08 Feb 2001 13:55:17 -0500
Message-ID: <3A82EB95.888544DE@rcn.com>

> CREATE TABLE temptable AS
> SELECT * FROM existingtable;
>
> DROP TABLE exisitingtable;
>
> CREATE TABLE (new definitions and column names);
>
> INSERT INTO existingtable
> SELECT * FROM temptable;
>
> DROP TABLE temptable;

Something a little quicker is the following:

CREATE TABLE newtable AS
SELECT col1, col2, col3 newcol, col4 . . . FROM oldtable;

DROP TABLE oldtable;

RENAME newtable TO oldtable; Received on Thu Feb 08 2001 - 12:55:17 CST

Original text of this message

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