Hi!
when gdscode grant_obj_notfound, gdscode grant_fld_notfound,
gdscode grant_nopriv, gdscode grant_nopriv_on_base
do
begin
execute procedure log_grant_error(gdscode);
exit;
end
But can I somehow get message text of the exception. The SQL procedures and triggers of my database raises exceptions in the form:
msg = 'Some serious error in document id '||:id;
execute procedure my_exception(:msg);
where the declaration is:
create or alter procedure my_exception (
MSG varchar(400))
as
BEGIN
exception FREEEXCEPTION substring(:MSG from 1 for 74);
END
Of course, FREEEXCEPTION is already declared exception, available in rdb$exceptions table with some initial text. I have not tested so far whether I can read the actual message text with the code:
select rdb$message
from rdb$exceptions
where rdb$exception_name='FREEEXCEPTION'
into :current_exception
but I guess: 'exception exception_name custom_text' is not changing rdb$exceptions record, it could lead to lot of deadlock conflicts.
And I have checked the Firebird 3.0 and Firebird 5.0 references manuals (context variable sections) and there were no context variables of the exception message either.
So - is it possible to get the message text in when... section?
Regards, Alex