标签:lex pre ret mysq logs create tiny cal exit
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;
标签:lex pre ret mysq logs create tiny cal exit
原文地址:http://www.cnblogs.com/cloniu/p/6400753.html