Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Posts
    50

    Unanswered: 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

  2. #2
    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.

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

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

    Hope this helps,
    Grofaty

Posting Permissions

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