▣ while loop 기초
SQL> declare
2 x number(12);
3 begin
4 x := 1;
5 while x<10 loop
6 dbms_output.put_line(x);
7 x := x+1;
8 end loop;
9 end;
10 /
1
2
3
4
5
6
7
8
9
PL/SQL procedure successfully completed.
▣ 무한루프와 해결책
S SCOTT> r
1 declare
2 x number(12);
3 begin
4 x:=1;
5 while x<10 loop
6 dbms_output.put_line(x);
7 -- x:=x+1;
8 end loop;
9* end;
S SYS> select sid,serial# from v$session
2 where username='SCOTT';
S SYS> alter system kill session '123,3859'; SID : 123, serial# : 3859
댓글 없음:
댓글 쓰기