Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange behavior of SQL Select
Message
From
11/03/1998 15:17:51
 
 
To
11/03/1998 15:16:17
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00083813
Message ID:
00083991
Views:
45
>>Hello everybody,
>>
>> I got very interesting problem and can't solve it... Whenever I try to run
>> following SQL statement:
>>
>>
>>  SELECT xgts.rtgts_leit  FROM gts02 xgts;
>>    WHERE xgts.rtgts_leit  IN  (291,273,266,259,249,246,240,238,231,218,210,209,200,;
>>                                181,170,169,165,159,153,150,146,141,115,108,105,102,;
>>                                91,85,75,49,41,33);
>>    INTO CURSOR cu_gtstree
>>
>>
>>I always receive error message "SQL expression is too complex". Help can't
>>help me too much, the explanation of error 1845 is "Visual FoxPro ran out
>>of memory when it tried to expand the SELECT statement in order to analyze it"
>>What the hell does it mean? I have 32 Megabytes of RAM on board and do not
>>think that it is small amount. I made some testing and found that the SQL
>>statement above works only if number of items within parentheses less than or
>>equivalent to 24. Does anybody have such an experience and what workaround
>>can be used for this case? I got only one thought to made severall SQL's to
>>reduce number of items within IN clause, but maybe there are other ways to
>>skin a cat?
>>TIA
>
>You can also try to separate the list into 2 select statements and use UNION to combine the results i.e.:
>
>SELECT xgts.rtgts_leit FROM gts02 xgts;
>WHERE xgts.rtgts_leit IN (291,273,266,259,249,246,;
> 240,238,231,218,210,209,200,181,170,169);
>INTO CURSOR cu_gtstree ;
>UNION ;
>SELECT xgts.rtgts_leit FROM gts02 xgts;
>WHERE xgts.rtgts_leit IN (165,159,153,150,;
> 146,141,115,108,105,102,91,85,75,49,41,33);
>INTO CURSOR cu_gtstree

Oops!
You need to take the INTO CURSOR cu_gtstree line from the first statement.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform