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 > SQL0101N / Statement too complex / STMTHEAP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-26-04, 08:12
c149187 c149187 is offline
Registered User
 
Join Date: Jul 2003
Posts: 50
SQL0101N / Statement too complex / STMTHEAP

Hi

I have the following SQL:

SELECT FK_ADRESSE_UUID
FROM ADU.UTADU_VERTRAG
WHERE STATUS<>4 AND PLZ='8600'
GROUP BY FK_ADRESSE_UUID HAVING (sum(BESTANDES_PRAEMIE)>10)

When I issue this statement, then I get a SQL0101N error (statement too complex or long)

If I put instead of the value 10 the value 100, it works. The lower the value is, the bigger the STMTHEAP has to be.

Example:
To let the following SQL work (instead of 100 the value 20)
SELECT FK_ADRESSE_UUID
FROM ADU.UTADU_VERTRAG
WHERE STATUS<>4 AND PLZ='8600'
GROUP BY FK_ADRESSE_UUID HAVING (sum(BESTANDES_PRAEMIE)>20)
I have to put the STMTHEAP from 2048 to 20480, but I can'z put the STMTHEAP to such a high value !

Is there another possibility ?

Marc
Reply With Quote
  #2 (permalink)  
Old 01-26-04, 18:00
cchattoraj cchattoraj is offline
Registered User
 
Join Date: Mar 2003
Posts: 343
You probably do but something I've had issues with at times - do you have statistics for the table and all it's indexes? And if you do are the values for num_freqvalues and Num_quantiles other than the defaults? That could affect the optimiser and could require more than normal statement heap.
Reply With Quote
  #3 (permalink)  
Old 01-27-04, 04:56
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

Please also see the following thread about command to complex..

Hope this helps,
Grofaty
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