Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Changing column names
> 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