How can I get error text in MySQL stored procedure when SQLEXCEPTION occurs?
I need something like this:
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN GET DIAGNOSTICS CONDITION 1 @p2 = MESSAGE_TEXT; INSERT INTO my_log (error_message) SELECT @p2; END;