Click here to Skip to main content
15,924,507 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

i have the following code

SQL
savepoint a;
update t1 set n1=18 where n1=13;
rollback to savepoint a;



but its giving error as savepoint a does not exists.
Pls help me to solve this.
Posted
Comments
Shubhashish_Mandal 11-Jan-13 3:53am    
check your mysql version.
"savepoint" is included from MySQL 4.0.14 and 4.1.1,
bluesky 2013 11-Jan-13 5:09am    
version is 5.5.16
Shubhashish_Mandal 11-Jan-13 8:03am    
I dont know whether you post the full or partial code. But did you begin the transaction?

1 solution

Try:
SQL
START TRANSACTION;
savepoint a;
update t1 set n1=18 where n1=13;
rollback to savepoint a;


also check the following link for example:


http://www.java2s.com/Code/SQL/Procedure-Function/savepointexample.htm[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900