7.6.9. SUSPEND
Used for
Passing output to the buffer and suspending execution while waiting for caller to fetch it
Available in
PSQL
Syntax
SUSPEND
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.
Important Notes
|
Example
Using the SUSPEND
statement in a selectable procedure:
CREATE PROCEDURE GEN_100
RETURNS (
I INTEGER
)
AS
BEGIN
I = 1;
WHILE (1=1) DO
BEGIN
SUSPEND;
IF (I=100) THEN
EXIT;
I = I + 1;
END
END
See also