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 -> Re: Renaming a column

Re: Renaming a column

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 24 Aug 1998 03:38:46 GMT
Message-ID: <35f0df17.25855709@netnews.worldnet.att.net>


On Sat, 22 Aug 1998 22:36:28 -0500, Lak Nadella <lak_at_more.net> wrote:

>Could someone give me pointers as to how I can rename a column in a
>table without dropping the table and recreating it?

I wish I could, oh i wish I could, but I cannot. You have to drop the table and recreate it.

There is actually one alternative if you can stand to do it:

  1. create a new column with the desired name.
  2. issue an update statement to set the new column to the value from the old column.
  3. make the old column nullable.

Now you can use the new column in all your programs, queries, etc. THe old column will hang around forever, but you can ignore it. It's a bit untidy.

regards,

Jonathan Gennick Received on Sun Aug 23 1998 - 22:38:46 CDT

Original text of this message

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