Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More about table updates
Message
De
20/07/2001 19:03:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00533368
Message ID:
00533406
Vues:
20
I see.. And this would mean starting the process over again. I suppose to prevent users from actually having to redo their orders or whatnot, it would have to be stored in some manner before the transaction, so that it it fails, there is a mechanism to retry until it succeeds? Am I on the right track now? Do you think it would be a trivial/difficult matter to store infromation for the transaction, or does it tend to be more of a case by case basis (depends on teh type of process you are trying to do)?

---
Jonathan Chan


>Take a look at BEGIN TRANSACTION, END TRANSACTION and ROLLBACK commands. Transaction is a mechanism built-in into the database to handle this type of scenario that you describe.
>
>This is the basic structure of a transaction with two tables. You can easily extend it to handle more tables:
>
>
>begin transaction
>
>lUpdateOk = TableUpdate( 2, .F., 'OneView' )
>if lUpdateOk
>   lUpdateOk = TableUpdate( 2, .F., 'AnotherView' )
>endif
>
>if lUpdateOk
>    * if all tables were updated successfully
>    * then commit changes to database.
>    end transaction
>else
>    * if any of the tables could not be updated
>    * revert all table updates.
>    rollback
>endif
>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform