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: Changing column name in oracle?

Re: Changing column name in oracle?

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: 2000/06/13
Message-ID: <us1bkscdbc93pnqtkt2khjli353sgi74ip@4ax.com>#1/1

On Mon, 12 Jun 2000 15:34:33 -0700, "Sunny" <sunnyb_at_vendtek.bc.ca> wrote:

>is it possible to change a table's column name

No. What I've done in the past when i've needed to change a column name without recreating the table is:

  1. Create new column with the name I want.
  2. Create insert & update triggers to keep the new column in sync with the one it is replacing.
  3. Execute an UPDATE statement to initialize the new column with data from the existing column.
  4. Tell programmers to use the new column.
  5. Eventually, when I get a window for downtime, rebuild the table.

Of course, if you can just rebuild the table to start with, that's easier and probably less risky.

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Tue Jun 13 2000 - 00:00:00 CDT

Original text of this message

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