MySql开启事务

 1 CREATE PROCEDURE test_sp1( )   
 2     BEGIN   
 3     DECLARE t_error INTEGER DEFAULT 0;   
 4     DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET t_error=1;   
 5    
 6         START TRANSACTION;   
 7             INSERT INTO test VALUES(NULL, test sql 001);      
 8             INSERT INTO test VALUES(1, test sql 002);      
 9    
10         IF t_error = 1 THEN   
11             ROLLBACK;   
12         ELSE   
13             COMMIT;   
14         END IF;   
15    
16     END

 

MySql开启事务,布布扣,bubuko.com

MySql开启事务

上一篇:Google谷歌搜索引擎登录网站 - Blog透视镜


下一篇:Entity Framework SqlFunctions 教你如何在EF调用sqlserver方法的函数存根