Chinaunix首页 | 论坛 | 博客

-

  • 博客访问: 165272
  • 博文数量: 48
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 490
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-22 18:51
文章分类

全部博文(48)

文章存档

2010年(23)

2009年(25)

我的朋友

分类:

2009-10-30 14:48:27

 
mysql中
#两种方式提交事务
#每行后面加';'
start transaction;
delete from xjgl_xsb where xsm='zhangsan';
commit;
 
begin;
delete from xjgl_xsb where xsm='zhangsan';
commit;
 
start transaction;
savepoint startonly;
delete from user where id='1';
savepoint  executeone;
delete from user where id='2';
savepoint  executetwo;
delete from user where id='3';
savepoint executethree;
delete from user where id='4';
savepoint executefour;
delete from user where id='5';
savepoint  executefive;
delete from user where id='6';
rollback to savepoint executethree;
commit;
#savepoint之前的语句执行完毕
 
 
阅读(2544) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~