Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
APPEND From FOR clause ignored in VFP6
Message
De
06/09/2002 14:35:12
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00697671
Message ID:
00697687
Vues:
12
This message has been marked as a message which has helped to the initial question of the thread.
Following is an extract form the Hacker's Guide for VFP7:
The time you're most likely to run into this is if the table you're copying from has a logical field indicating that it should be copied, but the field doesn't exist in the destination. Say there's an lArchive field in the source indicating that the record is ready to be archived. When you issue a command like:
USE Archive
APPEND FROM Source FOR Source.lArchive
the lArchive field is evaluated only for the current record of the source, not for each one in turn. So either all records or no records are copied. Setting a filter on the source table doesn't help; VFP ignores it. The workaround is to use a SQL SELECT statement to select the matching records into a temporary cursor, or COPY the records to a temporary file, and then APPEND from there.


Yes, the logic is surely odd and deserves elaboration in the Command Reference for APPEND FROM.

good luck



>SELECT estate
>zap
>APPEND FROM utemp For (SubStr(utemp.Submitter,1,1)="E")
>go bottom
>wait window estate.submitter
>
>Why would I get all records from UTEMP? I specified 'E' as first letter of first field!
>
>TIA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform