Environment versions
Network:
Windows 2000 Server
>I also have noted the change to the SQL - Select ... GROUP syntax, which now requires all fields other than aggregate functions to be specified (but VFP9 does not make this simple to do in the Query Wizard). Does this mean that my existing SELECTS within the VFP7 applications will not work? And if so, what do I lose by SETting ENGINEBEHAVIOR to 70?
The main reason for this change (other than more compatibility with the ANSI standard) is that having non-aggregated, non-grouped fields in a query can lead to wrong results. When a field is neither aggregated nor grouped, VFP chooses it randomly from the records in the group. (It turns out that for VFP, "random" here means "last.")
In some cases, that's not a problem. Specifically, if you're grouping on the parent id of a parent-child relationship, additional fields from the parent table will be accurate. But in the same situation, additional fields from the child table are likely to be wrong.
Another change (new in 9) is that you can't combine DISTINCT with memo or general fields. This is also about correct answers. In VFP 8 and earlier, when you do so, the memo and general fields aren't compared anyway. The DISTINCT applies only to the other fields, so you may get unexpected results.
On the whole, you're better off taking the time to fix your queries than using SET ENGINEBEHAVIOR. However, if you need to quickly get running in 9, the command can be a bandaid to give you time to rewrite your queries.
Tamar
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only