MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Adding 2 columns to a DB2 table

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
manesh
Beginner


Joined: 11 Apr 2006
Posts: 12
Topics: 5

PostPosted: Tue Mar 03, 2009 3:32 am    Post subject: Adding 2 columns to a DB2 table Reply with quote

Hi

I am able to add one column to the db2 table using ALTER as shown below,

ALTER TABLE TABLE_NAME
ADD NEW_CLOUMN_NAME1 DECIMAL(11,2)

When I am trying to ADD 2 columns in the same query it is failing,

ALTER TABLE TABLE_NAME
ADD NEW_CLOUMN_NAME1 DECIMAL(11,2)
NEW_CLOUMN_NAME2 DECIMAL(11,2)

I tried to search in the fourm and Google and couldn't find and concrete sugestion.
We are using DB2 V8.Is it possible to add multiple coloumns with single ALTER statement in DB2 V8??
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Mar 03, 2009 3:37 pm    Post subject: Reply with quote

Looking at the syntax of ALTER TABLE ADD column you can only add one column per ALTER
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
rrv
Beginner


Joined: 01 Nov 2004
Posts: 19
Topics: 6

PostPosted: Wed Mar 04, 2009 2:02 am    Post subject: Reply with quote

Manesh

Try this:

ALTER TABLE TABLE_NAME
ADD COLUMN NEW_CLOUMN_NAME1 DECIMAL(11,2) ;

ALTER TABLE TABLE_NAME
ADD COLUMN NEW_CLOUMN_NAME2 DECIMAL(11,2) ;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group