Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transaction and Deleted record
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00086139
Message ID:
00086254
Vues:
33
>>I need a little advise on the following situation :
>>
>>Code Example - select( table1 )
>> abc = fieldabc
>> if seek(upper( abc ),'table2','table2order')
>> DELETE in table2
>> repl someField with someValue in table1
>> tableupdate(0,.f.,'table1')
>> endif
>>
>>I am trying to make sure that record gets deleted in table2 and if so that table1.someField gets changed, but if delete can fail or if table1 update fails put back like it was to start with.
>>
>>Question 1.
>>Table2 is pess row buff, do I need to issue tableupdate or unlock after delete ? Could the delete fail ?
>>
>Yes, you need the tableudpdate for table 2. If you use transaction processing, there is no need to lock or to unlock. If an operation fails, tableupdate will return .f. and you will be able to rollback. End transaction does all the locking.
>
>
>>Question 2.
>>If I use BEGIN TRANS, END TRANS, ROLLBACK will the deleted record be put back if I issue ROLLBACK if any part of trans fails ??
>>*****
>
>That is exactly what rollback does, it returns your database in the state it was before you issued the begin transaction statement.
>
>
>HTH,
>
>Marc
Thank you for reply, I did a great deal of testing on this and decided that I will use Tranaction Processsing a lot more in the furute...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform