drop procedure if exists accessCount
delimiter $
create procedure accessCount()
BEGIN
DECLARE t_error INTEGER DEFAULT 0/*设置错误增量*/
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET t_error=1
START TRANSACTION/*开启事物*/
xxxx(你的语句)
IF t_error = 1 THEN /*执行失败回滚*/
ROLLBACK
ELSE
COMMIT
END IF
end $
delimiter
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)