3

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
Jonathan Elkins
  • 455
  • 5
  • 21

1 Answers1

4

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

Community
  • 1
  • 1
Gurwinder Singh
  • 38,557
  • 6
  • 51
  • 76