This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inserting a new column to an existing oracle table with a fixed value in all the rows of that column

 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am new to Oracle.I have a Java application which is mapped to the oracle table.

The table has about 500+ rows.I want to add a new column to this existing table with some fixed string in all the rows for the new column.How can I do this?

alter table
TEST_DOCBASE
add
docbase varchar(15) ;
creates a column "docbase" with null values inside the column.I want a string to appear in all the rows instead of null.How can I modify the above query to print a string say "abc" in all the rows of the docbase column?

Thanks in advance!
 
v krish
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By setting a default value

alter table
TEST_DOCBASE
add
docbase varchar(15) DEFAULT 'ABC' ;
 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply!

The issue is now resolved.

How can I delete a table?

Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moieen Khatri wrote:Thanks for the reply!

The issue is now resolved.

How can I delete a table?

Thanks

drop table_name;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic