"Robert Morgan" <[EMAIL PROTECTED]> wrote:
> 
> Hi I'm running mysql 4.0.14
> I'm doing an update from a webpage involving 3 tabIes, using 3 update queries and 
> need to be able to roll back to
> before the first update query if the second or third query go pear shape. So I need 
> to set a savepoint to rollback to
> if anyone could show me a an example of the code necessary it would be appreciated.
> 

Before the first UPDATE query create a savepoint

        SAVEPOINT savepoin_name

Then execute UPDATE queries. If you want to do rollback use 

        ROLLBACK TO SAVEPOINT savepoint_name

You can find info about savepoints at:
        http://www.mysql.com/doc/en/Savepoints.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to