Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# replacement for VFP code
Message
From
17/11/2006 03:02:46
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01167122
Message ID:
01170603
Views:
11
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 ?
Previous
Reply
Map
View

Click here to load this message in the networking platform