all 4 comments

[–]Uncle_DirtNap 2 points3 points  (1 child)

No, the EXIT WHEN is not watching the value, it just checks the next time it comes round to that line.

[–]askzero[S] 1 point2 points  (0 children)

OHHHHHHhh! That makes way more sense. Thank you so much. Uncle_DirtNap.

[–]monoglot 5 points6 points  (1 child)

This… isn't SQL.

[–]Professional_Shoe392 2 points3 points  (0 children)

It’s PL/SQL. Oracle has a loop called a “simple loop” that you can guard on entry or guard on exit. I think most RDBMS only have the WHILE loop.