Your update does miss a FROM clause. And if you would add it, you can't read file2.begrec and file2.endrec from one record of file2 and at the same time traverse file2 records to update file1, in short your logic is ill.
If you really want to update a range of file1 records rom the same range of file2 records, you'll first need to store beginrec and endrec in a variable each, then do your logic this way...
However then I assume your two files are a vertical split table with 1:1 records and you need to be cautious, that their record number really relates the right records to each other. It's recommended to have an ID column in both file1 and file2 then to have a stronger and more mandatory relation
Bye, Olaf.
PS: @pcelba: you can relate two dbfs based on the recno without any index.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
use file1 in 0
use file2 in 0
* locate file2 record determining the record range
lnBeginrec = file2.begrec
lnEndrec = file2.endrec
select file1
set relation to recno() into file2
replace field1 with file2.field1 for between(recno(),lnStartrec,lnEndrec) in file1
|