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: What is the way to rename or delete columns?

Re: What is the way to rename or delete columns?

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Thu, 12 Aug 1999 13:25:21 GMT
Message-ID: <37b3caa0.38595487@netnews.worldnet.att.net>


On Thu, 12 Aug 1999 09:12:14 +0800, "John" <hanjenq_at_ms21.hinet.net> wrote:

>It seems there is no way to delete or rename columns directly, but what is
>the best way to rename or delete columns?

You have to drop the table, and recreate it. I usually rename it first, create a new table with the correct columns and name, copy the rows from the old table to the new, and then drop the old. It's a royal pain to do when you have lots of constraints and indexes that you also have to recreate.

If you are pressed for time, you can just add a new column with the correct name, copy the data from the old column to the new, and leave the old one in the table. It'll take up space, but other than that it won't hurt anything. It's not unusual for me to do that in order to get the developers up and running quickly. Later, when I can schedule it, I take the time to remove the old column.

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Thu Aug 12 1999 - 08:25:21 CDT

Original text of this message

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