Home » RDBMS Server » Server Administration » rename a column
rename a column [message #374311] Tue, 05 June 2001 08:06 Go to next message
theresia
Messages: 9
Registered: May 2001
Junior Member
is it possible to rename a column in oracle?
if so how is it done?

regards
sini
Re: rename a column [message #374314 is a reply to message #374311] Tue, 05 June 2001 08:17 Go to previous messageGo to next message
Cindy
Messages: 88
Registered: November 1999
Member
Yes.

Try this:

SQL> select 'YOUR_COLUNM' NEW_NAME from dual;

NEW_NAME
-----------
YOUR_COLUNM

OR this:

SQL> select 'YOUR_COLUNM' "NEW_NAME" from dual;

NEW_NAME
-----------
YOUR_COLUNM
Re: rename a column [message #374326 is a reply to message #374311] Tue, 05 June 2001 16:34 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
In Oracle 8.1.5 or later you can drop a column, so
1.) Alter table ABC add column (NEW_COL...)
2.) update ABC set NEW_COL = OLD_COL;
-- If not null...
3.) alter table ABC modify (NEW_COL not null);
4.) alter table ABC drop column OLD_COL;
Previous Topic: Oracle "insertion problem"
Next Topic: Re: How to insert single quote (') in the row of table
Goto Forum:
  


Current Time: Thu Jul 04 20:53:39 CDT 2024