Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What is the way to rename or delete columns?
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
![]() |
![]() |