New answers tagged

2

According with the Mysql documentation https://dev.mysql.com/doc/refman/5.6/en/handler-scope.html you can create a handler with two handlers and the same scope, be aware of the precedence Example CREATE PROCEDURE p1() BEGIN DECLARE CONTINUE HANDLER FOR SQLSTATE '42S02' SELECT 'SQLSTATE handler was activated' AS msg; DECLARE CONTINUE HANDLER FOR ...


0

The problem is, that there are cases that backup statement returns more than one error, so ERROR_MESSAGE() is not enough. In the SQL Agent job that you use for backing up your DBs with backup devices, just have each step move onto the next step whether they fail or succeed. However, have the very last step have the below logic in it and tell it to ...


0

From MySQL manual: DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN GET DIAGNOSTICS CONDITION 1 code = RETURNED_SQLSTATE, error_string = MESSAGE_TEXT; END; I am just not sure about the use of local vs. user variables. User ones are visible for entire session and written in the @var form and if you need them, try to just adding @ to ...



Top 50 recent answers are included