Subject Re: [firebird-support] Re: for select do - statement in nested SP
Author Lucas Franzen
Ulrich,


Ulrich schrieb:

> Alan,
>
>
>>There is no return value for an SP unless you declare one. If you
>>declare
>>RETURNS, then you need a SUSPEND to return it.

That's not quite true.
Every procedure can return values without suspend.
Suspend is for returning MULTIPLE values (records).

Suspend is used for procedures that are selected from, without suspend
you have to execute the procedure and return one set of return parameters.

>
> I wish you could see the smile on my face! It's working AND
> everything is in only one SP AND no temporary table any longer! That
> is, what was in my mind when I started do write the SP.
>
> I thought, that SUSPEND must be in the <for select> loop to catch
> every selected record, but I only need it when I have something what
> I would like to give back with a return parameter....

SUSPEND is not for cvatching the record, it is for writing it to the
output stream.

Luc.