oracle 游标 查不出结果集 么原因啊。。新手请教
begin
insert into HR_NAIRESCORE_OPERATORID_TEMP select naireid,questionid,optionid,hr_nairescore.operatorid,groupid,userid from hr_nairescore inner join (select operatorid from hr_nairescore where naireid= 328
group by operatorid) t
on hr_nairescore.operatorid=t.operatorid
where naireid= 328 ;
insert into HR_NAIRE_QUESTION_TEMP
select Hr_Nairequestion.naireid,Hr_Questionoption.questionid, Hr_Questionoption.id as optionid,optionname
from Hr_Nairequestion
left join Hr_Questionoption on Hr_Nairequestion.questionid=Hr_Questionoption.questionid
where naireid= 328
order by questionid,optionid ;
insert into HR_NAIRE_RESULT_TEMP
select naireid,questionid, optionid,optionname,
(select count(1) from HR_NAIRESCORE_OPERATORID_TEMP where HR_NAIRESCORE_OPERATORID_TEMP.naireid=hr_naire_question_temp.naireid and HR_NAIRESCORE_OPERATORID_TEMP.questionid=hr_naire_question_temp.questionid and HR_NAIRESCORE_OPERATORID_TEMP.optionid=hr_naire_question_temp.optionid and hr_naire_question_temp.optionid<>0) as count,
(select count(1) from HR_NAIRESCORE_OPERATORID_TEMP where HR_NAIRESCORE_OPERATORID_TEMP.naireid=hr_naire_question_temp.naireid and HR_NAIRESCORE_OPERATORID_TEMP.questionid=hr_naire_question_temp.questionid and HR_NAIRESCORE_OPERATORID_TEMP.optionid<>0) as total
from hr_naire_question_temp ;
declare cursor c_emp is
select * from HR_NAIRE_RESULT_TEMP;
r_emp c_emp%rowtype;
begin
open c_emp;
Loop
fetch c_emp into r_emp;
exit when c_emp%notfound;
end loop;
close c_emp;
end;
end;
执行完了,什么也不显示,为什么???
------解决方案--------------------
--因为你没让它显示
set serveroutput on;