• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

column name

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends,
I have one small prob.
Can i chage column name of table in oracle.
if it is possible, how?
sunil
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sunil24",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.
Thanks.
David O'Meara
 
sunil24
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir,
Next time i will log with full name.
but waht ab ans of this question.
I want it urgent.
pl reply,
sunil
 
sunil24
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir,
Next time i will log with full name.
but waht ab ans of this question.
I want it urgent.
pl reply,
sunil
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all adding a new column to the table:
alter table tableName add newFieldName newFieldType(size);
Then populating this new column with old column which we want to delete:
update table tableName set newFieldName = oldFieldName;
Then finally, delete the old column:
alter table tableName drop column oldFieldName;
Example,
alter table test add fldnew varchar(40);
update table test set fldnew=fld;
alter table test drop column fld;
with regards,
Kshitij Raval

[This message has been edited by kshitij raval (edited October 22, 2001).]
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by kshitij raval:
First of all adding a new column to the table:
alter table tableName add newFieldName newFieldType(size);
Then populating this new column with old column which we want to delete:
update table tableName set newFieldName = oldFieldName;
Then finally, delete the old column:
alter table tableName drop column oldFieldName;
Example,
alter table test add fldnew varchar(40);
update table test set fldnew=fld;
alter table test drop column fld;
with regards,
Kshitij Raval

[This message has been edited by kshitij raval (edited October 22, 2001).]


Sunil24 : what version of Oracle are you Using ?
To kshitij raval:
I think this is possible only with Oracle8i. Not on versions lesser than that.
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
Yeah, Sundari is right. In older versions of Oracle you can create another table with your choice of column names and populate it from old table then drop the old table then rename the new table name to old table name.
Nasser
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic