mysql捕获所有错误处理

时间:2018-03-09 12:44:33

标签: mysql

有没有办法以与例外情况相同的方式捕获所有错误,例如异常可以像

一样被捕获
DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
      GET DIAGNOSTICS CONDITION 1
        `@failurecode` = RETURNED_SQLSTATE, `@failuremsg` = MESSAGE_TEXT;
            SELECT 'FAILURE' AS RESULT, `@failurecode` AS RESULTCODE,     
            `@failuremsg` AS RESULTMESSAGE;
    END;

可以在一个语句中捕获所有错误吗?

0 个答案:

没有答案