Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy tables!!
Message
De
07/09/1997 01:21:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00047638
Message ID:
00048861
Vues:
20
>Hi all,
>
>I having some problem of copying records from one table to another.
>I did the following:
>
>use table1
>
>scan for
> do case
> case f = 1
> e = 6
> otherwise
> endcase
> scatter fields like f_name, e to array
> use table2
> append blank
> gather from array fields f_name, e
>endscan
>
>The result I'm getting in the Table2 is that it ONLY copy one record from Table1 to Table2. And I know there are more than one records that could satisfy the scan for statement.
>Another problem I had is that the context of the field in Table2 is all mess up. Is there anyway to copy fields from one table to another without mess up the order. (I thought the scatter and gather command can be use to match specific fields that I want copy over)


Sam:

If your code above is the actual code, you have neglected to reselect table 1 before just the endscan; you are still in table 2 so you're only getting one record in table 1 processed. You must always be selected to the scanned table when the loop iterates.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform