gimme_this_gimme_that@yahoo.com wrote:[color=blue]
> I'm new to DB2 ...
>
> The following statement results in a SQL1585N message :
> "A system temporary table space with sufficient page size does not
> exist"
>
> Note that the column FIELD_DETAIL is a BLOB.
>
> Is there something inefficent about the SQL and CASE statement
> below that makes this error occur?
>
> Is there a more efficient rendering?
>
> How *large* should the temporary table need to be? At
> least as large as the largest BLOB?
>
>
> Thanks.
>
>
> SELECT DISTINCT ANNOUNCEMENT_HIGHLIGHT.ANNOUNCEMENT_HIGHLIGHT_ID,
> HEADLINE, ANNOUNCEMENT_TYPE, DESCRIPTION,
> TITLE, START_DATE, END_DATE, FILENAME , LINK_OR_TEXT, GENERIC,
> (CASE WHEN LENGTH(FILE_DETAIL) > 0 THEN 'YES' ELSE 'NO' END)
> FILE_UPLOADED
> FROM ANNOUNCEMENT_HIGHLIGHT , GROUP_ANNOUNCMENT_LOOKUP
> WHERE GROUP_ANNOUNCMENT_LOOKUP.ANNOUNCEMENT_HIGHLIGHT_ID =
> ANNOUNCEMENT_HIGHLIGHT.ANNOUNCEMENT_HIGHLIGHT_ID
> AND GROUP_ANNOUNCMENT_LOOKUP.GROUP_ID IN (
> 0,8,4,538,647,651,654,945,27,0)
> AND CURRENT TIMESTAMP >= START_DATE
> AND CURRENT TIMESTAMP <= END_DATE ORDER BY START_DATE DESC, TITLE
>[/color]
DB2 only stores a forward reference to the LOB within the row.
Teh amount of space needed to that reference varies by the worst case
size of the LOB. You will find details in the CREATE TABLE description.
The CASE expression (not a statement !) is most certainly innocent.
Either way. By default a DB2 database gets created with 4K pages. That
is the widest row (including for temp or sort) can be just shy of 4K wide.
DB2 supports up to 32K page sizes.
If you are truly ramping up with DB2 you can save yoruself soeme
learning by downloading DB2 V8.2.2 (FP9) and creating the DB with 32K
pagesize.
Otherwise you need to:
CREATE BUFFERPOOL with 32K pagesize
CREATE SYSTEM TEMPORARY TABLESPACE with 32K pagesize.
Then try again, it should work.
That's a one time thing for the DB, btw.
Cheres
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab