下面是代码: -- 打开游标 open v_temp for select D_COL1,L_COL2,L_COL3,L_COL4,L_COL5,C_COL1,C_COL2 from TEMP_TBSCCREPORT; loop fetch v_temp into v_calldate,v_callcount,v_successcount,v_failcount,v_onlinecount,v_date,v_time ; exit when v_temp%notfound; v_date := to_char(v_calldate,'yyyymmdd'); v_time :=to_char(v_calldate,'hh24:mi'); --08:45-09:15 if v_time >= '08:45' and v_time<= '09:15' then update TEMP_TBSCCREPORT set C_COL1 = v_date,C_COL2 ='08:45-09:15' where D_COL1=v_calldate ; ... end loop; commit; return v_temp; 那么这个游标里面的值有没有变化?
-- 打开游标
open v_temp for select D_COL1,L_COL2,L_COL3,L_COL4,L_COL5,C_COL1,C_COL2 from TEMP_TBSCCREPORT;
loop
fetch v_temp into v_calldate,v_callcount,v_successcount,v_failcount,v_onlinecount,v_date,v_time ;
exit when v_temp%notfound;
v_date := to_char(v_calldate,'yyyymmdd');
v_time :=to_char(v_calldate,'hh24:mi');
--08:45-09:15
if v_time >= '08:45' and v_time<= '09:15'
then
update TEMP_TBSCCREPORT
set C_COL1 = v_date,C_COL2 ='08:45-09:15' where D_COL1=v_calldate ;
...
end loop;
commit;
return v_temp;
那么这个游标里面的值有没有变化?
http://apq-hibernate.iteye.com/blog/1032655
如果不能更改返回的游标中的数据,那只好再新建一个游标然后返回了?数据量很大的话,那岂不是很浪费资源。