[ label_name : ] WHILE conditional_expression DO
statement [...]
END WHILE [ label_name ] ;
Syntax Elements
- label_name
- An optional label for the WHILE statement.
- If an ending-label is specified, you must specify a beginning-label that is equivalent to the ending-label. The beginning-label must be terminated by a colon character (:).
- The label name of the BEGIN END compound statement cannot be reused in an iteration statement. One label name cannot be reused within one group of nested WHILE statements, but can be reused for different non-nesting iteration statements.
- conditional_expression
- A boolean condition used to evaluate whether a statement or statements embedded within the WHILE loop runs.
- You cannot use IN and NOT IN operators if the conditional list contains any local variables, parameters, or cursor correlation names.
- OUT parameters are not allowed in conditional_expression.
- statement
- A list of statements to be run.
- The list can contain any of the following:
- DML, DDL or DCL statements, including dynamic SQL.
- Control statements, including BEGIN END.
- For details, see statement in FOR.