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.
RealityV15.1Online Documentation (MoTW) Revision 7
BREAK Statement (SQL) (m691509+break.htm)
Causes an immediate exit from a WHILE loop.
BREAK
The BREAK statement causes an immediate exit from the innermost enclosing WHILE loop. Any statements between the BREAK statement and the end of the loop are skipped.
SET @I = 0
SET @V1 = SECOND(CURTIME())+1
WHILE @I<10
BEGIN
SET @I = @I+1
SET @V2 = @V1*@I + @V1/@I
IF @V2>500 BREAK
INSERT INTO TESTDATA VALUES(@I,@V2)
END
Breaks out of the loop if @V2 is greater than 500.