Subject Re: [ib-support] nested procedures
Author Claudio Valderrama C.
""kisa933"" <kiss.sandor@...> wrote in message
news:a3bpp5+pgkr@......
>
>
> CREATE PROCEDURE PROC_D(
> VAR_INPUT SMALLINT)
> RETURNS (
> VAR_OUTPUT1 INTEGER)
> AS
> DECLARE VARIABLE VAR_LOCAL INTEGER;
> BEGIN
>
> ...
>
> IF VAR_LOCAL = SOMETHING THEN
> SELECT VALUE_NUMERIC
> FROM PROC_A(:VAR_OUTPUT)
> INTO :VAR_OUTPUT1;
> ELSE
> VAR_OUTPUT = 0;
> SUSPEND;
> END

Are you sure this is the code? It seems that you want instead
FROM PROC_A(:VAR_INPUT)
INTO :VAR_OUTPUT1;

If your code is correct, are you sure that PROC_A uses an input param whose
type can handle all the range of the passed argument? If A and D have
similar logic, it's possible that A's input param is a smallint but D is
passing an integer... good cause for an arithmetic exception.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing