I can\'t seem to find anywhere how to catch and re-throw any errors or warnings that can occur in a procedure.
What I want is the syntax to do the following:
<
To catch all SQL exceptions, use:
DECLARE EXIT HANDLER FOR SQLEXCEPTION
SQLWARNINGS
can be used to catch warnings also.
Inside the exception handler, to raise the error or warning that was just caught, use:
RESIGNAL
See the documentation for the RESIGNAL statement:
http://dev.mysql.com/doc/refman/5.5/en/resignal.html
This is available since MySQL 5.5