COF-C02 · Question #379
Which type of loop requires a BREAK statement to stop executing?
The correct answer is B. LOOP. In Snowflake Scripting, the LOOP construct is an unconditional infinite loop - it has no built-in termination condition. The only way to exit a LOOP is by using a BREAK statement (typically inside an IF condition). FOR loops iterate over a cursor or a fixed range and terminate…
Question
Which type of loop requires a BREAK statement to stop executing?
Options
- AFOR
- BLOOP
- CREPEAT
- DWHILE
How the community answered
(33 responses)- A9% (3)
- B88% (29)
- C3% (1)
Explanation
In Snowflake Scripting, the LOOP construct is an unconditional infinite loop - it has no built-in termination condition. The only way to exit a LOOP is by using a BREAK statement (typically inside an IF condition). FOR loops iterate over a cursor or a fixed range and terminate automatically. WHILE loops evaluate a condition before each iteration and stop when it is false. REPEAT loops execute the body first, then evaluate an UNTIL condition to decide whether to stop - they do not require BREAK.
Topics
Community Discussion
No community discussion yet for this question.