Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Begin Transaction, tableupdate..
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Begin Transaction, tableupdate..
Miscellaneous
Thread ID:
00745129
Message ID:
00745129
Views:
48
I want to write a small classlib that will handle tableupdates.
My idea starts something like this:



lPARAMETERS llUseTransaction, aTableUpdateArray

IF llUseTransaction = .T.
BEGIN TRANSACTION
ENDIF

lnNumberOfTables = ALEN(aTableUpdateArray, 1)

FOR lnCounter = 1 TO lnNumberOfTables
lcTableUpdateName = aTableUpdateArray[lnCounter, 1]
llTableUpdate = TABLEUPDATE(2, .F., &lcTableUpdateName, aUpdateError)


The questions I have are this:
1. Is there a way to determine if you're already in a transaction?
2. When using the tableupdate() command this way, if the lcTableUpdateName is a remote view, how should the code look if the command fails?
Begin Transaction
....then llTableUpdate = .F. ....
TableRevert(&lcTableUpdateName)
Rollback
End Transaction

...I guess I'm asking if I need both the tablerevert & Rollback if Im inside a transaction...

thanks!
ICQ 10556 (ya), 254117
Next
Reply
Map
View

Click here to load this message in the networking platform