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 -> Renaming a Column

Renaming a Column

From: Randall Woodman <rwoodman_at_verio.net>
Date: Mon, 16 Jul 2001 15:08:51 GMT
Message-ID: <3B530395.BAF04E0E@verio.net>

Sorry for the cross post but I'm desperate for an answer.

Is there a way to rename a column in an existing table? For example, suppose I had a table named FOO.

CREATE TABLE FOO (

  FOOWHO  VARCHAR2 (12)  NOT NULL,
  BARNONE VARCHAR2 (18)  NOT NULL,
  FOOBAR  VARCHAR2 (8)   NOT NULL,

)

Now suppose I want to rename the column FOOBAR to FUBAR. I know I could do the following

1. Add a new column called FUBAR
2. update the column FUBAR with the data in FOOBAR
3. Drop the column FOOBAR

However, I was thinking that there was a way to do this using a single ALTER statement. For example,
 alter table <table_name> rename column <column_name> new_column_name However, that doesn't work.

I'm running Oracle 8.1.6

Thanks for your help.

-=} Randall {=- Received on Mon Jul 16 2001 - 10:08:51 CDT

Original text of this message

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