If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Altering Columns, DB2 version 7.2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-06-06, 13:37
JStewart360 JStewart360 is offline
Registered User
 
Join Date: Oct 2005
Posts: 5
Altering Columns, DB2 version 7.2

We wish to increase the size of decimal columns on some tables from (11,2) to (16,2) and change some varchar columns from varchar(20) to varchar(40). Am I correct in believing that the only way to do this in DB2 7.2 is to unload the table, recreate the table, and load the table?
Reply With Quote
  #2 (permalink)  
Old 09-07-06, 02:31
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
alter table

this feature is not available in V7
yes : unload/drop/create/load is the way to go
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 09-07-06, 16:42
JStewart360 JStewart360 is offline
Registered User
 
Join Date: Oct 2005
Posts: 5
Well, that is somewhat primitive for a database. I realized they fixed it in v 8.0, but I am still somewhat surprised.
Reply With Quote
  #4 (permalink)  
Old 09-07-06, 17:23
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
V7 has been "out-of-support" for 2 years. V8 has been available for about 4 years.

But actually, V8 does not allow you to change a decimal column from (11,2) to (16,2), but you can increase the length of a VARCHAR.

In 8.2 there is a stored procedure used by the GUI interface in the Control Center (or anyone who wants to invoke the procedure manually) that will export the data, drop the table, recreate the table with the new difinitions, and reload the data.

I believe that DB2 Version 9 (now available) does allow you to change the decimal column definitions on the fly.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 09-08-06, 03:36
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
In 8.2 there is a stored procedure used by the GUI interface in the Control Center (or anyone who wants to invoke the procedure manually) that will export the data, drop the table, recreate the table with the new difinitions, and reload the data.


the procedure is sysproc.altobj
lack of details in info center makes it difficult to use (at least for me )
Reply With Quote
  #6 (permalink)  
Old 09-08-06, 05:25
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I guess it may be a consious decision not to document it ;-(

Search for altobj in the db2 forum and you should find reference to a newsgroup posting ...


Quote:
the procedure is sysproc.altobj
lack of details in info center makes it difficult to use (at least for me )
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On