Subject | Re: [firebird-support] Re: Exception hangling in stored procedure |
---|---|
Author | Michael Ludwig |
Post date | 2010-11-29T20:55:54Z |
tomkrej schrieb am 29.11.2010 um 08:23 (-0000):
straight to the WHEN handler without SUSPEND getting a chance to put the
data in the output slot or whatever it is called.
From experimentation I suspect they must not be followed by anything,
apparently with the exception of SUSPEND.
--
Michael Ludwig
> Hi, the code loked like thisPresumably because it jumps from the place where you raise the exception
>
> create procedure test_dostupnost (....)
> returns (je_dostupny smallint)
> begin
>
> je_dostupny = -1;
> execute procedure over_dostupnost_sklad(...);
> execute procedure over_dostupnost_obchod(...);
> ...
>
> je_dostupny = 1;
> suspend;
>
> when exception exc_nedost_sklad do
> je_dostupny = -2;
> when exception exc_nedost_obchod do
> je_dostupny = -3;
> ...
>
> end
>
> As I found in some exemple code. And it did not work (it returns empty
> dataset)
straight to the WHEN handler without SUSPEND getting a chance to put the
data in the output slot or whatever it is called.
> But after Your message I tried to enclose this code into the begin ..What exactly is the rule for the placement of WHEN exception handlers?
> end block and the suspend command after that block and, now it works.
>
> begin
> begin
> execute ...
> when ....
> end
>
> suspend;
> end
From experimentation I suspect they must not be followed by anything,
apparently with the exception of SUSPEND.
--
Michael Ludwig