Subject Reading GDSCODE inside a Trigger - FB1.52
Author John Peterson
Hi All,
Is it possible to obtain the value of the GDSCODE when an exception occurs within a trigger without explicitly using "when GDS_ERRNO....." syntax? Somtimes I need to catch all GDS errors and log.

Last week I had a situation where an insert was failing. Investigating showed one of the tables triggers was generating an SQLCODE = -901.
This error can caused be many (>100, I lost count) GDS errors.

I am logging errors such as this to a table using the following structure within my triggers:

for select......
where any begin
insert into error_log (SQLERR, GDSERR, stamp) values (SQLCODE, GDSCODE, current_datetime);

As documented SQLCODE returns the errror correctly, however, as also documented GDSCODE returns 0, which doesnt help to isolate the cause of the error, when the exact GDSCODE is unknown.

Thanks in Advance

[Non-text portions of this message have been removed]