全部博文(136)
分类: Oracle
2008-05-23 08:14:46
SQL>
declare 2
cursor cur_ic01 is 3
select * 4
from ic01 5
where rownum < 1002; 6 7
type tva_ic01 is varray(100) of
cur_ic01%rowtype; 8
va_ic01 tva_ic01; 9
begin 10
open cur_ic01; 11
loop 12
fetch cur_ic01 bulk collect into va_ic01
limit(100); 13
if va_ic01.count = 0 then exit; end
if; 14 15
-- Now you can manipulate the subset of 100. 16
dbms_output.put_line( 'COUNT: ' || va_ic01.count
); 17
end loop; 18
close cur_ic01; 19 20
va_ic01.delete; 21
end; 22
/ COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
100 COUNT:
1 PL/SQL 过程已成功完成。 |