SQL> set serveroutput on
SQL> DECLARE
2 just_a_num NUMBER := 1;
3 BEGIN
4 <>
5 LOOP
6 dbms_output.put_line(just_a_num);
7 EXIT just_a_loop
8 WHEN (just_a_num >= 10);
9
10 just_a_num := just_a_num + 1;
11 END LOOP;
12 END;
13 /
1
2
3
4
5
6
7
8
9
10
PL/SQL procedure successfully completed.
SQL>