存储过程问题,源码如下:CREATE OR REPLACE PROCEDURE "EDMS"."SP_CALL_MKOUVAL"
as
v_mettime varchar2(10);
execResult varchar2(50); begin
--每次从临时表中取出一条记录处理,处理完毕退出
--此语句用于行锁定
update lock_cmet1temp set id=1 where id=1; loop
select nvl(min(mettime),'1990') into v_mettime from cmet1_temp;
if v_mettime='1990' then
commit; --用于解锁
elsif v_mettime=to_char(sysdate,'yyyy/mm/dd') then
delete from cmet1_temp where mettime=v_mettime;
commit; --用于解锁
sp_tou(to_date(v_mettime,'yyyy/mm/dd'));
else
delete from cmet1_temp where mettime=v_mettime;
commit; --用于解锁
sp_tou(to_date(v_mettime,'yyyy/mm/dd'));
end if;
end loop; exception
when others then
splog('错误' ,3 ,execResult ,'');
end;帮我看看有什么错误?我实在看不出来,谢谢各位!
as
v_mettime varchar2(10);
execResult varchar2(50); begin
--每次从临时表中取出一条记录处理,处理完毕退出
--此语句用于行锁定
update lock_cmet1temp set id=1 where id=1; loop
select nvl(min(mettime),'1990') into v_mettime from cmet1_temp;
if v_mettime='1990' then
commit; --用于解锁
elsif v_mettime=to_char(sysdate,'yyyy/mm/dd') then
delete from cmet1_temp where mettime=v_mettime;
commit; --用于解锁
sp_tou(to_date(v_mettime,'yyyy/mm/dd'));
else
delete from cmet1_temp where mettime=v_mettime;
commit; --用于解锁
sp_tou(to_date(v_mettime,'yyyy/mm/dd'));
end if;
end loop; exception
when others then
splog('错误' ,3 ,execResult ,'');
end;帮我看看有什么错误?我实在看不出来,谢谢各位!
select nvl(min(mettime),'1990') into v_mettime from cmet1_temp;
if v_mettime='1990' then
commit; --用于解锁
exit;
elsif v_mettime=to_char(sysdate,'yyyy/mm/dd') then
delete from cmet1_temp where mettime=v_mettime;
commit; --用于解锁
sp_tou(to_date(v_mettime,'yyyy/mm/dd'));
exit;
else
delete from cmet1_temp where mettime=v_mettime;
commit; --用于解锁
sp_tou(to_date(v_mettime,'yyyy/mm/dd'));
end if;
end loop;