Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# replacement for VFP code
Message
De
17/11/2006 03:02:46
Walter Meester
HoogkarspelPays-Bas
 
 
À
09/11/2006 04:36:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01167122
Message ID:
01170603
Vues:
13
Kevin,

I still don't have an answer to this question:


One additional question that came to mind and no-one answered for me.

If I've got an order with several orderlines and I want to commit the order into one transaction. How would you implement that with SPs ?

In VFP I would use remote views and do something like:


INSERT INTO Orders (....) VALUES (....)
INSERT INTO Orderlines (.....) VALUES (....)
INSERT INTO Orderlines (.....) VALUES (....)
INSERT INTO Orderlines (.....) VALUES (....)
INSERT INTO Orderlines (.....) VALUES (....)


SQLSETPROP(Applic.SqlHandle,"transActions",2) && Manual Transaction
BEGIN TRANSACTION
IF TABLEUPDATE(2,.T.,"Orders") AND TABLEUPDATE(2,.T.,"OrderLines") AND SQLCOMMIT(Applic.SqlHandle) > 0
ENDTRANSACTION
ELSE
SQLROLLBACK(Applic.SqlHandle)
ROLLBACK
ENDIF
SQLSETPROP(Applic.SqlHandle,"transActions",1) && Automatic Transaction
How would YOU implement this with SPT ?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform