1

I'm trying to find an alternative to display the error-message returned from MySQL-5.1/5.5 inside a stored procedure.

The example below is what I'm looking for, however it's seems to be only allowed in version 5.6+ :

DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
      GET DIAGNOSTICS CONDITION 1
      code = RETURNED_SQLSTATE, 
      error_string = MESSAGE_TEXT;
END; 

Is there any alternative to skip this obstacle and get the original error message returned by MySQL during the execution of the stored procedure?
Thanks.

  • Didn't you ask this question somewhere else? And get an answer there? – Rick James May 26 '16 at 2:50
  • That was for MySQL version 5.6+, whatt I'm asking is if there is another solution to perform the same thing with MySQL 5.1 ( it's a subject of research). – Yassine LAADIDI May 26 '16 at 7:55
  • 1
    A bit of history... The initial implementation (in 5.1?) of Stored Routines was pretty lame and left out a lot of rather important features. I suspect (without hard knowledge) that there is no good solution in 5.1. – Rick James May 26 '16 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.