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 a BLOB column length

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-02-07, 12:24
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
Altering a BLOB column length

Hi All,

Env: DB2 UDB v8.2, FP 7a, OS: Windows 2003 Standard Edition

Can I alter a BLOB column length? My current BLOB column length is set to 15MB, can I increase it to 20MB using Alter table statement? I couldn't find the information anywhere specific to LOBs.

Thanks

Anks
Reply With Quote
  #2 (permalink)  
Old 04-02-07, 13:54
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I looked at the syntax diagram for ALTER TABLE .. ALTER COLUMN and it does not mention LOBS, so the answer is that you cannot change the length.


Andy
Reply With Quote
  #3 (permalink)  
Old 04-02-07, 14:10
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
So does that mean, the only way to change it is to recreate the table and export and import the data?

Thanks
Anks
Reply With Quote
  #4 (permalink)  
Old 04-02-07, 14:44
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Yes, but you can do it this way:

1) export data.
2) rename table
3) create new table
4) create all RI to new table
5) insert from old table or import
6) verify data
7) drop old table with new name

Andy
Reply With Quote
  #5 (permalink)  
Old 04-03-07, 10:51
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Use version 9 if possible. It allows many more column alterations, including changing the maximum allowed length for BLOB columns.

http://publib.boulder.ibm.com/infoce...c/r0000888.htm
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #6 (permalink)  
Old 04-03-07, 16:05
anksagr anksagr is offline
Registered User
 
Join Date: Jul 2005
Posts: 102
Thanks for everybody's input.

Anks
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