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 > max column value of clob

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-09, 14:33
gajapaga gajapaga is offline
Registered User
 
Join Date: Aug 2008
Posts: 9
max column value of clob

Hi,

I have a table with clob(500000), I was wondering if we can write a query to find the column with max column size.

Basically iam trying to alter the column to reduce the clob size for which i need to recreate the table before do that i wanted to know the avg max size.

thanks for you help.
Reply With Quote
  #2 (permalink)  
Old 01-27-09, 14:51
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think you can try the length() function.
Reply With Quote
  #3 (permalink)  
Old 01-27-09, 16:57
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Are you sure that you will never insert larger documents in the future? If so, you can do a MAX(LENGTH(column-name)) to find the value. But if you cannot rely on the documents never growing, this seems to be rather troublesome. After all, DB2 only allocates as much space as is needed for each document (not the full 500K). The only difference could be a few bytes in the LOB locator - but I wouldn't worry about that, except for benchmark situations.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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