Display the error message returned form Mysql I need to get the whole error message returned from MySQL and assign it to @error_string :

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION   
       BEGIN 
        SET @error_string = 'SQLEXCEPTION_ERROR_MESSAGE'; &lt;-- here
       END;


Is there any alternative, thanks.
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 the var names in that statement.