各位大侠
小的在执行存储过程中报错:“ORA-01403:未找到数据”
请指点迷津
create or replace procedure coverpl400reservea_b is
v_pl400_id
pl400.id%type;
v_pl400_contract_idpl400.contract_id%type;
v_pl400_emp_id pl400.emp_id%type;
v_pl401_id
pl401.id%type;
v_pl401_month
pl401.month%type;
cursor pl400list is
select t.id,t.contract_id,t.emp_id
from pl400 t
where
t.status in ('0','1')
and t.op_time>='20100129'
group by t.id,t.contract_id,t.emp_id;
begin
open pl400list;
loop
fetch pl400list
into v_pl400_id,v_pl400_contract_id,v_pl400_emp_id;
exit when pl400list%notfound;
select max(pl401.id) into v_pl401_id
from pl401
where pl401.contract_id=v_pl400_contract_id
and pl401.emp_id=v_pl400_emp_id;
select pl401.month into v_pl401_month ---------------------该行报错----------------
from pl401
where pl401.id=v_pl401_id;
update pl400 set pl400.reservea_b=v_pl401_month
where pl400.id=v_pl400_id;
end loop;
close pl400list;
end coverpl400reservea_b;
|