Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Help: Changing Column Names
john messina wrote:
>
> Hello,
>
> I'm currently looking for a method to change column
> names in a table without effecting the data already in the
> table. I'm currently using Oracle version 7 and I'm stumped.snip ...
John, you are on the right track. Create a new table with the new column name(s), copy the data to this new table. Drop your constraints on the old table, drop the old table. Rename the new table to the original name and then re-apply all the RI constraints. If you have an RI constraint that operated on a column that you have now renamed, you will have to change that constraint.
There are some 3rd-parth products on the market that take care of this for you, but how often do you actually rename or drop columns? Maybe it is worth it to you, maybe not.
-- R. Wayne Linton, I.S.P. Database & Systems Management Shell Canada Ltd.Received on Fri Jan 24 1997 - 00:00:00 CST
![]() |
![]() |