Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append Blank vs. Insert - SQL
Message
De
14/01/2000 11:12:42
 
 
À
14/01/2000 09:53:40
Dave Emerson
Dc Emerson Consult8Ng, Inc
Destin, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00318136
Message ID:
00318168
Vues:
29
>I am trying to avoid the "deadly embrace" syndrome with a shared network table. The documentation states that both APPEND BLANK and INSERT - SQL lock the table header and recommends using APPEND BLANK to avoid conflict, but I have thought that INSERT was the better method, however yesterday we had that dreaded conflict.
>
>What are the recommended procedures for multiple users adding records to the same shared table, i.e., SET REPROCESS, and APPEND BLANK vs. INSERT - SQL? In some cases a procedure may add numerous records over a short period.
>
>BTW I am using private datasessions in my forms and the application is in VFP 5.

You may get several different methods on this. I do all of this in a function/method which has a lot of code for checking status, error, etc., but what I generally do is to SET REPROCESS TO 1, set buffering to table buffering, use INSERT-SQL to add a record, then execute TABLEUPDATE() with the appropriate parameters for the situation and test the return value for success/failure. If success, we're good to go. If failure, check error codes to try to determine why. Depending on that, try again, and/or notify user of update conflict, etc. I usually put it in a loop which will try to update a certain number of times before just bailing out and TABLEREVERTing. Other may have more sophisticated methods.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform