DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 8th, 2006, 11:53 PM
ankitgupta_16 ankitgupta_16 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 2 ankitgupta_16 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 4 sec
Reputation Power: 0
Alter Table Command

Hi All

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.

Please help.

Thanks in Advance
Ankit

Reply With Quote
  #2  
Old November 11th, 2006, 12:43 AM
cfa99 cfa99 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 3 cfa99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 35 sec
Reputation Power: 0
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.



charles
--------------------------
(URL address blocked: See forum rules)

Reply With Quote
  #3  
Old November 13th, 2006, 04:43 PM
neodaba neodaba is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 2 neodaba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 49 sec
Reputation Power: 0
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')

neodaba

Reply With Quote
  #4  
Old February 12th, 2013, 01:44 AM
Sujit Doshi Sujit Doshi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 1 Sujit Doshi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 40 sec
Reputation Power: 0
Thumbs up Try this works

ALTER TABLE BXKTLZ4T.CUSTOMER
ADD CUST_SAL INTEGER
ADD CUST_DESIGNATION VARCHAR(20)
ADD CUST_OFC_ADDRESS VARCHAR(50);

BXKTLZ4T-->schema name
CUSTOMER-->table Name
Imp thing is dont put comma after every statement

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Alter Table Command

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap