1 – beginning-label:
Assigns a name to the REPEAT statement. A beginning label used with the LEAVE statement lets you perform a controlled exit from a repeat loop. A named repeat loop is called a labeled repeat loop statement. A beginning label must be unique within the procedure in which the label is contained.
2 – END REPEAT ending-label
Marks the end of a control loop. If you choose to include the optional ending label, it must match exactly its corresponding beginning label. An ending label must be unique within the procedure in which the label is contained. The optional ending-label argument makes multistatement procedures easier to read, especially in complex multistatement procedure blocks.
3 – REPEAT compound-use-statement
Repeatedly executes a block of SQL statements until an end condition is met, as specified by the UNTIL predicate clause.
4 – UNTIL predicate
Specifies a condition that controls how many times SQL can execute the statements embedded within its REPEAT . . . UNTIL block (collectively referred to as its compound statement). SQL executes the compound statement once and then evaluates the UNTIL condition. If it evaluates to false or NULL (unknown) and does not encounter an error exception, SQL executes the compound statement again. Each time the search condition evaluates to false or NULL, the REPEAT statement executes the compound statement. If the UNTIL condition evaluates to true, SQL bypasses the compound statement and passes control to the statement after the END REPEAT statement.