BEGIN DECLARE t_error INTEGER DEFAULT 0; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET t_error=1; START TRANSACTION; #这边放sql语句,涉及到的表必须都为InnoDB IF t_error = 1 THEN ROLLBACK; ELSE COMMIT; END IF; END
转自:http://www.cnblogs.com/bossikill/p/3682839.html
时间: 2024-10-26 18:15:21