Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement