mysql 事务回滚

时间:2017-03-01 16:09:09   收藏:0   阅读:247

begin
declare t_error integer default 0;
declare continue handler for sqlexception set t_error=1;

#set autocommit =0;
start transaction;
update mol_userlevelright set UserSetValue=20 where id=9;
if t_error = 1 then
rollback;
else
commit;
select 1;
end if;
end

原文:http://www.cnblogs.com/makqiq/p/6484567.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!