mysql 异常信息捕捉


 DECLARE CONTINUE HANDLER FOR SQLWARNING,SQLEXCEPTION
                                begin
                                            GET DIAGNOSTICS CONDITION 1
                                                mysql_error_code = RETURNED_SQLSTATE, mysql_error_msg = MESSAGE_TEXT;
                                                set  V_DATA_FAIL_NUM = V_DATA_FAIL_NUM+1;-- 异常失败
                                                set  VO_RETCODE = '-1';
                                                set  VO_RETMSG = concat( VO_RETMSG , V_BRANCH_CODE ,'异常',mysql_error_msg);
                                                ROLLBACK;
                                end;
                  

 

posted @ 2020-10-12 09:22  骚年丶勿忘初心。  阅读(445)  评论(0编辑  收藏  举报