Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INSERT-SQL
Message
 
 
To
14/08/1997 19:52:02
Larry Long
ProgRes (Programming Resources)
Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00044588
Message ID:
00044881
Views:
38
>>So all records have to be copied from the source table to an array first then inserted into the target table. I forget which one only locks file header versus locking the entire file (shared file use), either inserting records or appending from.
>The file has to be locked with both insert and append, because the record counter is in the header. Also, I believe that insert is supposed to be much faster.

Curiosity got the best of me, and I had to look this up. In Jeb Long's VFP 3 Developer's Guide is a chart of how commands are affected by autolocking
(pp 1269-1270). *Append From* locks the table , Append From Array, Append Blank and Insert (SQL) all lock the header only. Granted, both effectively lock the table and prevent new attemts by users to lock either the table or the header (but should not prevent new attempts at record locking). But, if another user on the system has an existing record locked for editing, you could still use the Insert SQL to add records to the table without affecting the other user(s) who have only record locks in place. You could not do this with *Append From*. So in a heavily used multi-user system, Insert SQL is the way to go (IMHO) to prevent some contention.

Of course, much of this has been alleviated by table buffering. And, VFP does very well managing automatic file and record locking when used with buffering.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform