Subject Re: Merging 2 dbf
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 6 Dec 2019 22:35:51 +0200
Newsgroups dbase.getting-started

On 05/12/2019 22:04, Randy Waldman wrote:
> dBase Plus19 User asking:
> Is there a more efficient way to combine 2 databases with some of the fields the same:
> My code:
> SELECT * FROM tableA WHERE company = \'Discount Furniture'
> Copy to MyMerge1
> SELECT * FROM tableB WHERE company = \'Discount Furniture'
> Copy to MyMerge2
> USE MyMerge1
> APPEND FROM myMerge2
> If necessary to make a UNION or JOIN, I can select only the necessary matching fields.
> Thanks, Randy

You can simplify the coding a bit by mixing localSQL and XDML commands
although the old saying "If it works it's not wrong" is appropriate. :-)

select * from tableA where company = 'Discount Furniture' save to MyMerge

use MyMerge
append from tableB for company = 'Discount Furnishers'

You can also have a look at the updateSet class if you want to do this