Subject Re: [IBO] Stored procedure, ExecSQL and Suspend
Author Paul Vinkenoog
Hi Marco, Lele, all...

Lele wrote:

> PV> I have several SP's that do a singleton SELECT into the return
> PV> variables, without SUSPEND, and they've been working fine
> PV> since more than a year.
>
> Yup, this surprises me, even more the fact that neither your example,
> nor my even simpler one
>
> CREATE PROCEDURE test$suspend RETURNS (a INTEGER, b VARCHAR(10)) AS
> BEGIN
> a = 1;
> b = 'lele';
> END
>
> work as you state. I executed a "SELECT * FROM test$suspend" in a
> IB_DSQL, and it correctly (from my POW) returns an empty dataset.

That's because you SELECT from an _executable_ SP. Executable SPs
don't return a dataset, they return output values. I just dropped an
IB_StoredProc onto a form, had it execute your SP and it returned the
data in the output fields.

It also works in the Form Designer and from IB_SQL: just execute the
procedure and look under the Fields tab, where you'll find 1 and
'lele'. Under the Data tab there is an empty dataset. The only thing
that's confusing is that under the Data tab, the field names A and B
are also mentioned, suggesting that this SP "ought to" return a
dataset.

BTW: Marco: perhaps in your case it didn't work without the SUSPEND
because you had the StoredProcForSelect property of the IB_StoredProc
set to true. In my experience (with both IB and FB, IBO 3.x and 4.x)
TIB_StoredProc works like it's supposed to.


Greetings,
Paul Vinkenoog