Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
WHILE Statement (SQL) (m691509+while.htm)
Allows SQL statements to be repeated.
WHILE condition statement
condition
An SQL Search Condition.
statement
A supported SQL statement, or a group of statements enclosed in the
BEGIN and END
keywords.
While condition evaluates to true, the WHILE statement executes statement repeatedly.
SET @I = 0
SET @V1 = SECOND(CURTIME())+1
WHILE @I<10
BEGIN
SET @I = @I+1
SET @V2 = @V1*@I + @V1/@I
INSERT INTO TESTDATA VALUES(@I,@V2)
END
Loops, executing the block of three statements for each value of variable @I. The loop terminates when @I becomes equal to 10.