Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UDF in SQL
Message
From
24/11/1998 15:34:22
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00160448
Message ID:
00161088
Views:
28
>>>>I'd suggest putting an
>>>>
   OTHERWISE
>>>>      RETURN SPACE(12)  && Or whatever
>>>>
>>>>in that CASE statement, just in case....
>>>Ed R. Suggested that, too. It worked, which showed me that the SQL was IIIFing
>>>records that didn't match my WHERE clause. Theoretically, there never should
>>>have been an otherwise case.
>>
>>Yeah, I noticed that after I posted. :-( My experience has been that you should always put the OTHERWISE clause in, because sooner or later, something will slip through....
>
>Normally, I'd agree. But in this case I had no otherwise to put. If it wasn't one of those three, then it shouldn't've been there. I didn't allow for VFP doing things screwy, I guess. :)

VFP isn't really doing anything 'screwy'; you've made some assumptions about when certain aspects of the WHERE clause evaluation is taking place, and the odds are that, by quirk of fate, VFP is constructing a temporary index on the evaluated UDF before filtering the recordset. If you take a look at the documentation, you are warned that the order of evaluation of joins and projects is not necessarily determined by the order of the statements in the WHERE and JOIN clauses; VFP is given the flexibility to perform segments of the WHERE clause to attempt better optimization. If you must have WHERE clause sections evaluated in order, you'd better encapsulate things explicitly with parentheses to force evaluation in specific order.


>
>-Michelle
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform