Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2008

    Unanswered: max column value of clob


    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.

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    I think you can try the length() function.
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Jan 2007
    Jena, Germany
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts