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