[Info-ingres] raise error crocked?

Roy Hann specially at processed.almost.meat
Wed Jun 5 13:24:28 UTC 2019


Martin Bowes wrote:

> Hi All,
>
> II 11.0.0 (a64.lnx/100) + p15426
>
> What am I doing wrong?
>
> create procedure inner
> as
> begin
>     raise error 99999 'inner(): I''m bad';
> end;
>
> create procedure outer
> as declare
>     msg  varchar(256) not null;
>     enum integer4 not null not default;
> begin
>     execute procedure inner;
>     select iierrornumber into :enum;
>     if (:enum != 0) then
>         msg = 'call to inner has error: ' + varchar(:enum);
>     else
>         msg = 'call to inner OK';
>     endif;
>     message :msg;
> end;
>
> And so when I execute procedure outer;
>
> I get:
>
> MESSAGE 0: call to inner OK
> inner(): I'm bad
>
> It's like the error code I asked for has just not been set.

I can confirm this is long-standing behaviour. I would say it's a bug.

But it's been that way for so long some might argue it has to
be accepted as a permanent misfeature now. (I don't feel like accepting
that.)

Roy



More information about the Info-ingres mailing list