Passing output to the buffer and suspending execution while waiting for caller to fetch it
Available in
PSQL
The SUSPEND
statement is used in a selectable stored procedure to pass the values of output parameters to a buffer and suspend execution. Execution remains suspended until the calling application fetches the contents of the buffer. Execution resumes from the statement directly after the SUSPEND
statement. In practice, this is likely to be a new iteration of a looping process.
Example
Using the SUSPEND
statement in a selectable procedure:
CREATE PROCEDURE GEN_100
RETURNS (
)
AS
BEGIN
WHILE (1=1) DO
SUSPEND;
IF (I=100) THEN
EXIT;
I = I + 1;
END
See also