>In my ongoing saga of legacy code in FP2.6 for DOS (ugh), I found someone doing something like:
>
>Scan
> Scatter Memvar
> Insert Into Booked From Memvar
>Endscan
>
>The reason I was given for doing this was that they could not allow the record/table to be locked as would be the case with the append command. This code is incredibly slow. Is there a way around this witout locking tables?
You got pretty 'interesting' explanation, kind of those which drag Foxpro down. Insert-SQL actually locks Table header only (APPEND does the same) and also INSERT-SQL is faster than APPEND BLANK+REPLACE.
Your example is slow just because you SCAN big table. It will be a little help if you change SCATTER MEMVAR to SCATTER TO ARRAY, but the nice solution would be:
SELECT * From ... Into array aTempo && it can be limited by array size
INSERT Into Booked From Array aTempo
Edward Pikman
Independent Consultant