File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes inserting a new column to an existing oracle table with a fixed value in all the rows of that column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "inserting a new column to an existing oracle table with a fixed value in all the rows of that column" Watch "inserting a new column to an existing oracle table with a fixed value in all the rows of that column" New topic
Author

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

Moieen Khatri
Ranch Hand

Joined: Nov 27, 2007
Posts: 144
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

Joined: Mar 08, 2007
Posts: 1
By setting a default value

alter table
TEST_DOCBASE
add
docbase varchar(15) DEFAULT 'ABC' ;
Moieen Khatri
Ranch Hand

Joined: Nov 27, 2007
Posts: 144
Thanks for the reply!

The issue is now resolved.

How can I delete a table?

Thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Moieen Khatri wrote:Thanks for the reply!

The issue is now resolved.

How can I delete a table?

Thanks

drop table_name;


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: inserting a new column to an existing oracle table with a fixed value in all the rows of that column
 
Similar Threads
Runtime Creating Tables
table row creation problem
MySQL table joining
Custom Table Model - Add Column
ERROR OGG-01163 Bad column length, and CHAR data type