create or replace procedure stat_user_mdiacli_active_num as
startTime date;
endTime date;
media_id number(19);
media_name char(50);
active_num number(19);
filter_num number(19);
cursor media_cursor is
select id, media_name from media;
begin
starttime := trunc(sysdate - 1, 'dd');
endtime := trunc(sysdate - 1, 'dd') + 1;
filter_num := 1;
open media_cursor;
if filter_num <= 5 then
loop
fetch media_cursor
into media_id, media_name;
exit when media_cursor%notfound;
select *
into active_num
from (select count(*)
from (select count(*) num, lp.news_id
from log_para lp
where lp.add_date >= startTime
and lp.add_date <= endTime
and lp.media_id = media_id
and lp.url like '/client/%'
and lp.reader_id > 0
group by lp.reader_id) v
where v.num >= filter_num);
insert into user_type_mdiacli_active_num
values
(sysdate - 1, media_id, media_name, active_num, filter_num);
end loop;
filter_num := filter_num + 1;
end if;
close media_cursor;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RETURN;
END stat_user_mdiacli_active_num;
编译通过了,但报告下列错误
Compilation errors for PROCEDURE GO.STAT_USER_MDIACLI_ACTIVE_NUM
Error: Hint: Value assigned to 'filter_num' never used in 'stat_user_mdiacli_active_num'
Line: 36
Text: filter_num := filter_num + 1;