I have stored procedure that calls another stored procedure. Let’s call them OUTER and INNER.
The INNER procedure can detect errors in the input and if it does it will raise/signal it like this
signal sqlstate '45000' set message_text = 'some error';
In OUTER procedure I’m able to catch this with a normal handler like this
declare exit handler for sqlstate '45000'
begin
-- this is where I'd like to access the message_text from INNER
end
but I fail to find a way of reading the internal parts of the signal.
I’ve seen that it might be available in 5.6 but that isn’t GA yet and will probably be shaky for a while after release.
Any takers on this.?
As this is not available until 5.6 I ended up creating a stored procedure that both sends the signal but also sets the error text in a session varible