| 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: 26167
|
|
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
|
 |
 |
|
|
subject: inserting a new column to an existing oracle table with a fixed value in all the rows of that column
|
|
|