时间:2021-07-01 10:21:17 帮助过:14人阅读
delimiter \create PROCEDURE p1( OUT p_return_code tinyint ) BEGIN DECLARE exit handler for sqlexception BEGIN -- ERROR set p_return_code = 1; rollback; END; DECLARE exit handler for sqlwarning BEGIN -- WARNING set p_return_code = 2; rollback; END; START TRANSACTION; DELETE from tb1; insert into tb2(name)values(‘seven‘); COMMIT; -- SUCCESS set p_return_code = 0; END\delimiter ; set @i =0; call p1(@i); select @i;
Mysql-事务
标签:lex pre ret mysq logs create tiny cal exit