Terminates the execution of an iterated SQL statement and begins the next iteration of the iterative statement in the loop.
ITERATE runs the following actions depending on the referenced iteration statement.
Referenced Iteration Statement | Result |
---|---|
FOR statement | IF a next row in the cursor, exists, execution continues with the next statement in the FOR loop. IF a next row in the cursor does not exist, the cursor is closed and execution continues with the next statement outside the corresponding END FOR terminator for the FOR loop. |
LOOP statement | First statement inside the LOOP block runs unconditionally. |
REPEAT statement | First statement inside the REPEAT loop runs next, without any evaluation of the UNTIL clause. |
WHILE statement | IF the conditional expression for the WHILE statement evaluates to TRUE, execution continues with the first statement inside the WHILE loop. If the condition expression for the WHILE statement does not evaluate to TRUE, execution continues with the next statement outside the corresponding END WHILE terminator for the loop. |
ANSI Compliance
ITERATE is ANSI/ISO SQL:2011-compliant.
Required Privileges
None.
Invocation
Executable
Stored procedures only.