This shows you the differences between two versions of the page.
— |
break [2015/09/23 20:26] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== BREAK Statement - PL/HQL Reference ====== | ||
+ | |||
+ | BREAK statement exits the innermost loop. | ||
+ | |||
+ | Syntax: | ||
+ | |||
+ | <code language=sql> | ||
+ | BREAK; | ||
+ | </code> | ||
+ | |||
+ | **Example:** | ||
+ | |||
+ | <code language=sql> | ||
+ | DECLARE count INT DEFAULT 3; | ||
+ | WHILE 1=1 BEGIN | ||
+ | SET count = count - 1; | ||
+ | IF count = 0 | ||
+ | BREAK; | ||
+ | END | ||
+ | </code> | ||
+ | |||
+ | **Compatibility:** Microsoft SQL Server. | ||
+ | |||