Exforsys

Online Training

Rename column name

This is a discussion on Rename column name within the Oracle Database forums, part of the Database category; How can I change the name of the column ? and in big sized database design if I change the name ...


Go Back   Exforsys > Database > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2007, 02:43 AM
Junior Member
 
Join Date: Aug 2005
Posts: 11
jyaseena is on a distinguished road
Rename column name

How can I change the name of the column ? and in big sized database design if I change the name of the column How can we solve this cumbersome task..?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-25-2007, 03:03 AM
Junior Member
 
Join Date: Apr 2007
Posts: 2
anwar_s1 is on a distinguished road
Solution

Quote:
Originally Posted by jyaseena View Post
How can I change the name of the column ? and in big sized database design if I change the name of the column How can we solve this cumbersome task..?
First:


Alter table <tablename>

drop column <columnname>

Second:

Alter table <tablename>
add(<columnname> <datatype>)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-25-2007, 05:01 AM
Junior Member
 
Join Date: Aug 2005
Posts: 11
jyaseena is on a distinguished road
dear friend

my question is to change the name of COLUMN , not the name of Table..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-25-2007, 10:46 AM
Senior Member
 
Join Date: Apr 2006
Posts: 153
cyrus is on a distinguished road
You can rename a column in a table as follows:

ALTER TABLE tablename RENAME COLUMN oldcolumn TO newcolumn;

I would suggest that you must be careful and assured while designing the database itself regarding these. Only if it is very essential go for this process now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-25-2007, 11:32 AM
Senior Member
 
Join Date: Apr 2006
Posts: 141
Adrian is on a distinguished road
You can also rename by adding a column with a new name and dropping old columns. This can be done as below:

alter table t1 add ( newcolame datatype );
update t1 set newcolname=oldcolname;
alter table t1 drop column oldcolname;

Try as suggested and let us know the result.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-28-2007, 12:57 PM
Junior Member
 
Join Date: Aug 2005
Posts: 11
jyaseena is on a distinguished road
Error comeing...!!

Quote:
Originally Posted by cyrus View Post
You can rename a column in a table as follows:

ALTER TABLE tablename RENAME COLUMN oldcolumn TO newcolumn;

I would suggest that you must be careful and assured while designing the database itself regarding these. Only if it is very essential go for this process now.
I used above command but there is error message as below

ORA-14155:Missing partition or SUBPARTITION keyword
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-30-2007, 01:27 PM
Junior Member
 
Join Date: Aug 2005
Posts: 11
jyaseena is on a distinguished road
No One To Help Me...!!!!!

Quote:
Originally Posted by jyaseena View Post
I used above command but there is error message as below

ORA-14155:Missing partition or SUBPARTITION keyword
no one to help me please....!!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Want to change the datatype of the column siri6589 Oracle Database 2 04-22-2007 11:44 AM
Oracle : 'Creating Search Pages' DEVELOPER: Frameworks Column techguru Oracle Tutorials 0 08-27-2005 04:35 PM
[FAQ] FileMaker Pro - database for Macintosh and Windows Martin Trautmann Tech FAQ 0 04-17-2004 07:26 AM


All times are GMT -4. The time now is 10:58 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.