Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan, Append or What?
Message
From
30/07/1997 16:41:34
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00042472
Message ID:
00042476
Views:
31
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform