Quote:
|
Originally Posted by naveen_swiz
Hi,
I have a Large Tablespace of 16k and system temporary tablespace of 32k. I have the following problem when I use an SQL statement that has more than one row in the order by clause in DB2.
SQL Query : SELECT RECID FROM TAFJV_FSG1_SWAP WHERE "REVALUATION_TYPE" IS NOT NULL or "FWD_REVAL_PL_LCY" IS NOT NULL
and "VALUE_DATE" <= '20090706 ' ORDER BY "AS_CURRENCY","MATURITY_DATE"
Exception : SQL1585N A system temporary table space with sufficient page size does not exist.
The columns AS_CURRENCY,MATURITY_DATE are of type VARCHAR of length 32000.
Is there any way to increase the page size of System Temporary Tablespace? Or do i need to remove few columns from Order By Clause?
|
Your design seems silly. You have VALUE_DATE as a string (CHAR or VARCHAR) when it should be a DATE. You have MATURITY_DATE as VARCHAR(32000) when it should also be DATE (or something more reasonable if you want to store string characters).
DB2 does not support silly database designs.
No, you cannot have a system temp tablespace larger than 32K. You can use the SUBSTR, RTRIM, or CAST functions to make them smaller in the select list and/or the ORDER BY.