Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# replacement for VFP code
Message
From
09/11/2006 14:01:32
Walter Meester
HoogkarspelNetherlands
 
 
To
09/11/2006 13:57:58
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01167122
Message ID:
01168519
Views:
20
>Kevin,
>
>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
     END TRANSACTION
>ELSE
>    SQLROLLBACK(Applic.SqlHandle)
>    ROLLBACK
>ENDIF
>SQLSETPROP(Applic.SqlHandle,"transActions",1) && Automatic Transaction
>
>
>How would YOU implement this with SPT ?
>
>Walter,
Previous
Reply
Map
View

Click here to load this message in the networking platform