Pervasive logo

Prev SQL Engine Reference Next

WHILE


Use a WHILE statement is used to control flow. It allows code to be executed repeatedly as long as the WHILE condition is true.

Syntax

[ label-name : ] WHILE proc-search-condition 
  DO [ proc-stmt [ ; proc-stmt ] ]... END WHILE [ label-name ] 

Remarks

A WHILE statement can have a beginning label (the statement is referred to as a labeled WHILE statement).

Examples

The following example increments the variable vInteger by 1 until it reaches a value of 10, when the loop ends.

WHILE (:vInteger < 10) DO 
SET :vInteger = vInteger + 1; 
END WHILE

See Also

CREATE PROCEDURE

CREATE TRIGGER


Prev
USER
Contents
Up
Check for Revisions
Next
Grammar Element Definitions