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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Changing column name

Re: Changing column name

From: <rspeaker_at_my-deja.com>
Date: Mon, 13 Sep 1999 14:47:02 GMT
Message-ID: <7rj2p1$n1k$1@nnrp1.deja.com>


there is no way to change a column name once the table has been built. you have a couple different ways to handle, but none are as simple as renaming the column.

(1) you can drop and recreate the table with the desired column names. This would require you to unload and reload any critical data, either with exp/imp or by duplicating the table before dropping (ie COPY TABLE to TMP_TABLE; then reloading with INSERT INTO TABLE SELECT * FROM TMP_TABLE;) (2) rename the existing table and create a view with the desired column names (CREATE VIEW TABLENAME as SELECT col1, col2, col3 newname, col4 FROM OLDTABLENAME;) I'm not certain, but I believe I read somewhere that Oracle 8i provides this renaming capability.

HTH,
Roy

In article <01befcd5$0fcbca40$d6f67ad1_at_johnboy>,   "carlanco" <askmefirst_at_yahoo.com> wrote:
> How can I change the name of the column once the table has been
defined?
> Thank you.
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Sep 13 1999 - 09:47:02 CDT

Original text of this message

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