Collection Contents Index WHENEVER statement [ESQL] WRITETEXT statement [T-SQL] pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

WHILE statement [T-SQL]


Function 

To provide repeated execution of a statement or compound statement.

Syntax 

WHILE expression
... statement

Authorization 

None.

Side effects 

None.

See also 

LOOP statement

Description 

The WHILE conditional affects the performance of only a single SQL statement, unless statements are grouped into a compound statement between the keywords BEGIN and END.

The BREAK statement and CONTINUE statement can be used to control execution of the statements in the compound statement. The BREAK statement terminates the loop, and execution resumes after the END keyword marking the end of the loop. The CONTINUE statement causes the WHILE loop to restart, skipping any statements after the CONTINUE.

Standards and compatibility 

Example 


Collection Contents Index WHENEVER statement [ESQL] WRITETEXT statement [T-SQL] pdf/chap9.pdf