Subject | Custom error message from procedure/trigger code in Firebird 3.x dialect 3 |
---|---|
Author | |
Post date | 2018-10-07T16:06:01Z |
Hi!
Sometimes I need to write extended error message from the SQL procedure and trigger code. So far I have used the following procedure:
create or alter procedure REPORT_ERROR (MSG varchar(400))
asBEGIN
update rdb$exceptions set
rdb$message=:MSG
where rdb$exception_name='MY_ERROR'; exception ERRMSG_;
END
But in Firebird 3.x UTF8/dialect 3 I am receiving the error message while using this function (even as SYSDBA user):
UPDATE operation is not allowed for system table RDB$EXCEPTIONS.
So - how can I report custom errors from the SQL procedures and triggers, it would be nice the generate some information in procedures and triggers and let the Delphi error-handling code to process this information for the user presentation.