Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More about table updates
Message
From
20/07/2001 19:03:40
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00533368
Message ID:
00533406
Views:
22
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
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform