Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange APPEND FROM problem
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01108188
Message ID:
01108389
Vues:
15
>>Of all the suggestions made here, the one that has worked best for me across all versions of VFP is
>>
>>select * from cursor you want to append from into cursor c_AddThese NOFILTER
>>
>>select targetcursor
>>append from dbf("c_AddThese")
>>
>>That's because the select * command allows you to join from many tables, do filtering and change field names to match the target cursor all in one step.
>>
>>The final append from command is as simple as it can get.
>
>Mike,
>
>Thank you for your suggestion. I might try it and compare with the one INSERT-SQL command. My main goal is to make the resulting cursor filled as fast as possible. Secondly, if I switch the database to SQL Server, I would like to make the code work there (I am sure with some minor modifications) too. I don't think APPEND FROM is a valid syntax in SQL Server, although I may be mistaken.


Using INSERT SQL the way Fabio showed would work in both VFP and SQL Server without modifications. You also eliminate a need of extra cursor.

Mike, for new development I would suggest you to use insert into tablename select from myOtherTable syntax. The speed should be the same or even quicker to do in one step instead of two.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform