From: <no...@so...> - 2002-04-23 03:28:09
|
Bugs item #547383, was opened at 2002-04-23 03:28 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109028&aid=547383&group_id=9028 Category: Core Engine Group: Initial Bug Status: Open Resolution: None Priority: 9 Submitted By: Helen Borrie (helebor) Assigned to: Nobody/Anonymous (nobody) Summary: 3 bugs in exception handling in SPs Initial Comment: 1. According to docs, exceptions can be trapped by using the GDSCODE keyword with WHEN, e.g. WHEN GDSCODE 35544778 do begin DO SOMETHING; exit; end However, the compiler barfs on the GDSCODE keyword. 2. According to the docs, "RDB$EXCEPTIONS describes error conditions related to stored procedures, including user-defined exceptions." The table includes a smallint RDB$SYSTEM_FLAG for which the description is "Indicates whether the exception is * User-defined (value of 0) *System-defined (value greater than 0)" Taken together, this seems to indicate that system exceptions should be in RDB$EXCEPTIONS but, in fact, this table is empty except for any user-defined exceptions. This is the case for FB and all IB versions from 5.6 forward. I don't have a 4.x server any more but I seem to recollect that this table was populated by CREATE DATABASE at one time and the doc seems to assert this. 3. There seems to be no way to read either SQLCODE or GDSCODE into a host variable in a SP. For example, this can't be too much to ask: .. declare variable _SQLCODE_ integer; ... when ANY do _SQLCODE = SQLCODE; However, the compiler rejects SQLCODE as an invalid token. All in all, it seems SPs can trap only UDE's and the generic SQLCODE exceptions, which makes exception handling pretty ugly and makes liars out of the documenters. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109028&aid=547383&group_id=9028 |