I have the following in a Firebird (version 2.1) stored procedure. When an exception occurs I get the GDSCODE and the SQLCODE but I can't figure how to get the descriptive error message text that goes with the error. Is it possible to do so? Is there a variable like SQLERRORTEXT or some such? My search of Google has not turned up any.
begin
insert into BOOKING_STATUS (status_id, description) values ("test1", "test1");
when any do begin
error_code = 1;
error_message = "Error inserting booking_status. Error: " || GDSCODE || " " || SQLCODE;
suspend;
exit;
end
end
Unfortunately, this is not possible in your version of firebird. Take a look at this request.
It turns out that this facility is present in Firebird 4.0+.
Similar questions:
In FirebirdSql, how to return exception message from procedure
Firebird - handling exception's custom-message
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With