First page Back Continue Last page Image

The Format for an Error Handler

DECLARE CONTINUE or EXIT HANDLER

FOR

mysql_error_code or

SQLSTATE sqlstate_code or

named_condition

handler_actions;

This option specifies what is to happen when the event occurs, Does the procedure CONTINUE or does it EXIT

In this section, I have 3 error detection options: MySQL Error Codes

SQL State Codes

or one of the 3

Built in Named Conditions

DECLARE CONTINUE HANDLER FOR NOT FOUND

SET row_not_found = TRUE;

This section establishes what to do when the event happens

So Using the previous Handler as an Example, we have: