ops$tkyte@ORA9IR2> declare
2 xx number := 1;
3 begin
4 for i in (select 1 from dual
5 union all
6 select 2 from dual)
7 loop
8 dbms_output.put_line( 'top of loop 1' );
9 for x in (select * from user_tab_partitions)
10 loop
11 dbms_output.put_line( 'top of loop 2' );
12 exit when xx > 1;
13 dbms_output.put_line(x.table_name);
14 xx := xx + 1;
15 dbms_output.put_line( 'bottom of loop 2' );
16 end loop;
17 dbms_output.put_line( 'bottom of loop 1' );
18 end loop;
19 end;
20 /
top of loop 1
top of loop 2
MYEMP
bottom of loop 2
top of loop 2 <<<=======
bottom of loop 1 <<<=======
top of loop 1 <<<=======
top of loop 2
bottom of loop 1
PL/SQL procedure successfully completed.
It does just exit the inner loop. that shows we went from the top of loop2 to the bottom of loop 1 and back to the top again...