begin
for i in 1..10 loop
insert into players
values (i, 'Player '||to_char(i)||' entered.');
end loop;
p(to_char(i)||' data inserted'); --> 에러가 발생하면서 Tx 롤백 되었습니다.
end;
/
↓ ↓ ↓
declare
c number := 0;
begin
for i in 1..10 loop
insert into players
values (i, 'Player '||to_char(i)||' entered.');
c := c + 1;
end loop;
p(to_char(c)||' data inserted');
end;
/
-----------------------------------------
select * from players;
'Oracle > PL/SQL' 카테고리의 다른 글
15일차 # 5-29: Sequential Control: GOTO and NULL Statements (0) | 2012.04.24 |
---|---|
15일차 # 5-27: Nested Loop and Label (0) | 2012.04.24 |
15일차 # 5-20: WHILE Loop (0) | 2012.04.24 |
15일차 # 5-18: Basic Loop (0) | 2012.04.24 |
15일차 # 5-17: LOOP Statements (0) | 2012.04.24 |