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: Changing column names

Re: Changing column names

From: EXE <exe_at_exesolutions.com>
Date: Sat, 12 Sep 1998 21:17:03 -0700
Message-ID: <35FB473F.B01C52EA@exesolutions.com>


> Could somebody tell me the SQL / Oracle syntax for changing a column
> name that contains data, without losing the data?

CREATE TABLE new_table ( field definitions);

INSERT INTOP table_name

   SELECT *
   FROM old_table;

DROP old_table;

In other words it can not be done.

> I would have thought schema-manager would allow this, but I can't see
> an obvious way - therefore I am hoping there is a simple 'update'
> command in SQL that somebody could show me :)

Actually you can do this by making changes in the data dictionary tables but I don't put that type of advice into a newsgroup where someone might accidentally destroy a system. The main advantage of the above is that it allows you to resize the initial extent size to more accurately reflect the data in the table.

Daniel A. Morgan Received on Sat Sep 12 1998 - 23:17:03 CDT

Original text of this message

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