Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Begin Transaction, tableupdate..
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Begin Transaction, tableupdate..
Divers
Thread ID:
00745129
Message ID:
00745129
Vues:
49
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform