>create cursor recordsToProcess (myPK i) >rand(-1) >for i = 1 to 10 > * hope we don't get lucky and create a duplicate :) > insert into recordsToProcess values (rand()*500000) >next i > >Create Cursor myTest1 (myPk i, myVal c(10)) >For ix=1 to 1000000 > Insert into mytest1 values (ix, Sys(2015)) >endfor >Index On myPK tag myPK > >AFields(arrNew) >Create Cursor myTest2 from array arrNew >Create Cursor myTest3 from array arrNew > > >lnStart = Seconds() >Select recordsToProcess >scan > select myTest1 > scan for myTest1.mypk = recordsToProcess.mypk > Scatter memvar > Insert into myTest2 from memvar > endscan > >endscan >? Seconds()-lnStart > > >lnStart = Seconds() >Select recordsToProcess >scan > select myTest3 > Append From Dbf('myTest1') for myPK = recordsToProcess.myPk >endscan >? Seconds()-lnStart >Who knows maybe I'd change the above code slightly to get all into an SQL cursor first and do a single append (no for), or create an index for recordstoProcess.myPk and drop scan again ( append .. for seek(myPk,'recordsToProcess','key') ), or copy to array, insert from array in blocks etc (last one is an exceptionaly fast method but coding generally complex)