Subject Re: [firebird-support] ?s on returned values/suspend/stored procedures/their termination, etc.
Author Ivan Prenosil
> Various places indicate its necessary to place a "suspend" in stored
> procedures in order for the output data generated to be retrievable.
...

It is pretty simple. If you have stored procedure with output parametrs, then
- if you call it via SELECT then for each executed SUSPEND it will return result row
- if you call it using EXECUTE PROCEDURE then it will return single set of output values
when it encouters either of SUSPEND / EXIT / end of SP.

Example:

CREATE OR ALTER PROCEDURE P RETURNS(X INTEGER) AS
BEGIN
X=10; SUSPEND;
X=20; SUSPEND;
X=30; SUSPEND;
END

SELECT * FROM P;
X
===========
10
20
30

EXECUTE PROCEDURE P;
X
===========
10


> Is it possible to (safely) have simultaneous (same connection)
> executions of a stored procedure with different input parameters,
> returning different output datasets, and interleave the retrieving of
> results from them?

Yes.

Ivan
http://www.volny.cz/iprenosil/interbase/