Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select Optimisation changes under VFP8?
Message
From
03/06/2003 12:09:48
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
03/06/2003 12:06:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00795674
Message ID:
00795745
Views:
23
>>The following code behaves exactly the same way under VFP 6-8. It evaluates the function for every record.
>>CREATE CURSOR Test (Field1 N(10))
>>FOR lnCount = 1 TO 20
>>	INSERT INTO Test VALUES (lnCount)
>>ENDFOR
>>
>>SELECT * FROM Test ;
>>	WHERE Field1 >= 10 AND IsEven(Field1)
>>
>>FUNCTION IsEven(tnNumber)
>>	? "Number is: " + TRANSFORM(tnNumber)
>>	RETURN (MOD(tnNumber, 2) = 0)
>>ENDFUNC
>
>PMFJI, Unless there is an index on field1. Which seems to still evaulate the number 1 twice, for somereason? But either way it still the same in VFP 6 and VFP 8 in my test also.

You're right! That's very weird.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform