View previous topic :: View next topic |
Author |
Message |
manesh Beginner
Joined: 11 Apr 2006 Posts: 12 Topics: 5
|
Posted: Tue Mar 03, 2009 3:32 am Post subject: Adding 2 columns to a DB2 table |
|
|
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 |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Mar 03, 2009 3:37 pm Post subject: |
|
|
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 |
|
|
rrv Beginner
Joined: 01 Nov 2004 Posts: 19 Topics: 6
|
Posted: Wed Mar 04, 2009 2:02 am Post subject: |
|
|
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 |
|
|
|
|