Mike Yearwood
Toronto, Ontario, Canada
>>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.
select * from sourcecursor into cursor c_AddThese NOFILTER
INSERT into target select * from c_AddThese
It is seldom enough to aim for raw speed. I rarely see any piece of code that is that simple. There would often be some kind of validation or preparation of the c_AddThese records. Bearing that in mind, why not use the two cursors everytime for the sake of safety and flexibility?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only