以下是我的脚本,在cmd下运行后,输出是0,可是我的表mmm里是有数据的
declare cursor cur
is
select id from mmm;
begin
open cur;
dbms_output.put_line(cur%ROWCOUNT);
end;
/
declare cursor cur
is
select id from mmm;
begin
open cur;
dbms_output.put_line(cur%ROWCOUNT);
end;
/
declare
cursor cur is select * from emp;
rs emp%rowtype;
begin
open cur;
loop
fetch cur into rs ;
exit when cur%notfound ;
dbms_output.put_line(cur%ROWCOUNT);
end loop;
close cur;
end;
/32 PL/SQL block, executed in 0.234 sec.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Total execution time 0.266 sec.