Subject Re: [ib-support] Suspend in stored procedures
Author Paul Reeves
Solon Edmunds wrote:
> I've noticed that suspend should be put at the end of stored
> procedures..

Not necessarily.

> And that my stored procedures don't have it, but appear to work fine
> (ib6.01)

There are two types of SP - executable and select. You have probably only
found a need for the former, which don't use 'suspend' and don't even need
'exit' although it is good practice to specify the exit point.

> What effect could not putting suspend in stored procedures have?

Perhaps that question should be inverted. If you put suspend in the procedure
it will literally suspend operation, returning the values currently in the
returns params. It then continues execution. Suspend is typically used with a
For Select loop to iterate through each row of a result set, return a row on
each suspend. Such a procedure is selectable and called with 'Select blah from
myproc(x,y,z)', rather than 'execute myproc(x,y,z)'.

Selectable stored procedures allow you to do server side computations on
datasets, to join datasets in ways that may otherwise be tricky with SQL
and/or simplify the security model by allowing users access to an SP but not
an underlying table.

You really need to dig out the Language Reference - it is all explained in


Paul Reeves
taking InterBase further