SUSPEND
STATEMENT

Suspends execution of a PSQL routine until the
next value is requested by the calling application, and returns
output values, if any, to the calling application.

If the procedure is called from a select
statement, processing will continue at the statement following
SUSPEND when the next row of data is needed. Use the EXIT statement –
or let the code path end at the final END of the body – to
signal that there are no more rows to return.

If the procedure is called from a EXECUTE
PROCEDURE statement, then SUSPEND has the same effect as EXIT. This
usage is legal, but not recommended.

Examples

The below creates a procedure that returns the a
series of integers and stops as soon as a value larger than 1000 has
been reached.

ftrKBB I have been reading out some of your articles and i must say nice stuff. I will definitely bookmark your blog.

Contributed by crorkzz backz on 5 February 2015 06:54 PM

KosEay Very nice post. I just stumbled upon your blog and wished to say that I\'ve truly enjoyed surfing around your blog posts. In any case I\'ll be subscribing to your feed and I hope you write again soon!