存储过程返回值 问题请教

[复制链接]
查看11 | 回复3 | 2011-11-1 16:20:28 | 显示全部楼层 |阅读模式
下面这个存储过程总报错
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;
回复

使用道具 举报

千问 | 2011-11-1 16:20:28 | 显示全部楼层
procedure怎么能return isfull
回复

使用道具 举报

千问 | 2011-11-1 16:20:28 | 显示全部楼层
去掉该行,那是函数的用法
回复

使用道具 举报

千问 | 2011-11-1 16:20:28 | 显示全部楼层
谢了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行