下面这个存储过程总报错
PLS-00372: In a procedure, RETURN statement cannot contain an expression
啥原因?
再return isfull; 这行。
create or replace procedure pre_chk_file_by_time(station_id in varchar2, timet in varchar2,isfull out number )
is
v_date varchar2(8);
v_time varchar2(2);
v_filename varchar2(512);
v_total number;
v_num number;
v_pos number;
---取得所有文件名
cursor c_file is
selectsubstr(filepath,instr(filepath,'_',-1)+1) as filename
from stationfile where substr(filepath,instr(filepath,'_',-1)+1)
like'%'||timet||'%'
and station_id=station_id;
begin
v_num:=0;
v_total:=0;
v_pos:=0;
selectcount(*) into v_total
from stationfile where substr(filepath,instr(filepath,'_',-1)+1)
like'%'||timet||'%'
and station_id=station_id;
open c_file;
loop
fetch c_file into v_filename;
EXIT WHEN c_file%NOTFOUND;
--取得E的位置
select instr(v_filename,'E') into v_pos from dual;
if v_pos >0then
--取得片段的个数
select to_number(substr(v_filename,v_pos-1,1)) into v_num from dual;
end if;
--已经加载文件个数统计
--v_total:=v_total+1;
end loop;
close c_file;
if v_total=0 then isfull:=0;
elsif v_total=v_num and v_total>0 then isfull:=1;
else isfull:=0;
end if;
return isfull;
end pre_chk_file_by_time;
|