Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET ENGINEBEHAVIOR changing
Message
From
15/08/2005 09:34:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01040906
Message ID:
01040958
Views:
21
>>I'm with you:) Knowing what you should expect from return ENGINEBEHAVIOR doesn't return incorrect results. They might be 'incorrect' from ANSI standards POV but VFP SQL is not fully ANSI standard anyway. Sometimes what's proposed as 'incorrect' is the actual resultset that one would like to get. ie: Assuming logintime field is physically resembles actual logintime order:
>>
>>select loginId, logintime from myTable group by 1
>>
>>would be 'correct' resultset showing last logintimes per ID. Or consider another sample:
>>
>>select customer.*, max(order_date) as lastordate ;
>> from customer ;
>> left JOIN orders ON orders.cust_id = customer.cust_id ;
>> group by customer.cust_id
>>
>>would give perfectly 'correct' result with ENGINEBEHAVIOR 70.
>>
>>In migration what I do is "set enginebehavior to 70" in main.prg and where I can revise or write new SQL wrap it:
>>
>>set enginebehavior 90
>>*...
>>set enginebehavior 70
>
>Cetin,
>
>Your query will produces incorrect result if the assumption is incorrect. Properly written query doesn't require any assumptions.

If you write code that'd make the assumption a reality in the first place then it works out as perfect. If data with physical order does not match the time order you already have problem in data you have. Proper query doesn't help you identifying that situation.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform