Procedure error handling Best Practice
- Date: Wed, 28 Feb 2018 13:51:21 -0800
- From: Michael Moore <mmoore@xxxxxxxxxxxxxx>
- Subject: Procedure error handling Best Practice
Long time Oracle PL/SQL coder but new to MySQL.
I have an error handler that looks like this ...
declare continue handler for sqlexception
get diagnostics condition 1 @p3 = returned_sqlstate, @p4 = message_text;
set v_there_was_an_error_while_inserting_a_lead_summary := true;
insert into rit.rit_audit_message(severity,
concat('Something went wrong while trying to insert commission lead summaries. No summaries created! ',
So, what if the insert (shown above) throws a sqlexception?
1) What happens?
2) Is there a better way to do this? Perhaps I should not have DML in my error block?