|
From: Christian D. <chr...@da...> - 2003-11-25 17:31:26
|
Hi Helen,
at the 'SQLCODE and GDSCODE' section of the FB 1.5 Release Notes, I
found the following example:
BEGIN
...
WHEN SQLCODE -802 THEN
EXCEPTION E_EXCEPTION_1;
WHEN SQLCODE -803 THEN
EXCEPTION E_EXCEPTION_2;
WHEN ANY DO
EXECUTE PROCEDURE P_ANY_EXCEPTION(SQLCODE);
END
I would interpret '...' as a list of statements, which the WHENs are
responsible for.
This syntax matches with a remark in the IB6 Language Reference, page
179:
IMPORTANT
If used, WHEN must be the last statement in a BEGIN...END block.
It should come after SUSPEND, if present.
TTFM? As far as I know a WHEN-Clause (including all-or-nothing
rollback-capability) is relevant only for the _single_ preceding
statement (or BEGIN...END block). Then the upper example would be
misleading and should be replaced by something like:
BEGIN
...
END
WHEN SQLCODE -802 THEN
EXCEPTION E_EXCEPTION_1;
WHEN SQLCODE -803 THEN
EXCEPTION E_EXCEPTION_2;
WHEN ANY DO
EXECUTE PROCEDURE P_ANY_EXCEPTION(SQLCODE);
Kind regards,
Christian
|