Home » RDBMS Server » Server Administration » Change collumn name
Change collumn name [message #371631] Thu, 16 November 2000 21:28 Go to next message
tarun
Messages: 13
Registered: November 2000
Junior Member
Anyone know whether it is possible to change column names in Oracle 8i.

thanks

Tarun
Re: Change collumn name [message #371657 is a reply to message #371631] Mon, 20 November 2000 14:08 Go to previous message
John Dorlon
Messages: 3
Registered: November 2000
Junior Member
There is no one-line command to do this, but if you don't mind having your column in a different position you can do in a series of SQL statements like this :

alter table {tablename} add ({new column name});

update {tablename} set {new column name} = {old column name};

alter table {tablename} drop column {old column name};

In older versions of Oracle, you have to rebuild your table to get a new column name.
Previous Topic: Looking for a pl-sql book - pls
Next Topic: DBMS_SQL. to create user..
Goto Forum:
  


Current Time: Thu May 02 21:55:07 CDT 2024