Forums | Webyog
Tools to manage and monitor MySQL databases
forums › forums › SQLyog › Using SQLyog › Stored Procedure Error Handling
Tagged: error, handling, procedure, Stored
I’m in the middle creating stored procedure in SQLyog. Could someone help me on error handling? can I use try and cathe in SQLyog? please help me give some sample.
Try catch is not used in MySQL.
Mostly error handling in stored procedure is done by DECLARE … HANDLER please refer-http://dev.mysql.com/doc/refman/5.7/en/declare-handler.html
You can use this in stored procedure to execute some specific task if error occurred(same as you do in catch) and then exit or continue.
To derive the exact nature of the error you can use GET DIAGNOSTICS please refer-http://dev.mysql.com/doc/refman/5.6/en/get-diagnostics.html
SQLyog doesn’t have any specialized way of doing error handling.
thanks for your help