Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP9 vs VFP7 compatibility
Message
De
10/06/2005 14:09:12
 
 
À
10/06/2005 11:15:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01022163
Message ID:
01022252
Vues:
11
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform