NexusDB Manual V3 > SQL Reference > SQL Statements > Control Statements
Start a new iteration.
Syntax
<iterate statement> ::= ITERATE
Usage
The ITERATE statement can only be specified in the body of the REPEAT and WHILE statements to start a new iteration from the first statement in the block.
See also: LEAVE statement
Examples
DROP FUNCTION IF EXISTS dummyFunc; CREATE FUNCTION dummyFunc( p1 INTEGER ) RETURNS INTEGER BEGIN DECLARE v1, v2 INTEGER; SET v1 = 10; SET v2 = 10; WHILE v1 > 0 DO SET v1 = v1 - 1; IF v1 <= 5 THEN ITERATE; END IF; SET v2 = v2 - 1; END WHILE; RETURN v2 + p1; END; SELECT dummyFunc( 15 ) FROM #dummy;
Conformance
|
© Nexus Database Systems Pty Ltd.