November 8th, 2006, 11:53 PM
Alter Table Command
I am new to Db2.
I am trying to alter a table by adding six new columns to it.
I am not able to do so in a single shot.
I am able to add a single column at a time.
Does DB2 allows multiple column additions to a table in one alter table command.
Thanks in Advance
November 11th, 2006, 12:43 AM
Yes DB2 allow inserting multiple columns in one time. If you are able to do them one at a time you are missing something whene trying all of them at once.
What version of DB2 you have annd on which platform.
I currently use DB2 on the AS/400.
You could also try to post the code here to havea look.
(URL address blocked: See forum rules)
November 13th, 2006, 04:43 PM
I got this example from (URL address blocked: See forums rules)=/com.ibm.db2.udb.doc/admin/r0000888.htm
Example 8: Alter the EMPLOYEE table to add 4 new columns with default values.
ALTER TABLE EMPLOYEE
ADD COLUMN HEIGHT MEASURE DEFAULT MEASURE(1)
ADD COLUMN BIRTHDAY BIRTHDATE DEFAULT DATE('01-01-1850')
ADD COLUMN FLAGS BLOB(1M) DEFAULT BLOB(X'01')
ADD COLUMN PHOTO PICTURE DEFAULT BLOB(X'00')
February 12th, 2013, 01:44 AM
Try this works
ALTER TABLE BXKTLZ4T.CUSTOMER
ADD CUST_SAL INTEGER
ADD CUST_DESIGNATION VARCHAR(20)
ADD CUST_OFC_ADDRESS VARCHAR(50);
Imp thing is dont put comma after every statement