fetch next from问题

wch_212 wch_212 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区



create or replace procedure generateLouName(unuse in varchar2) is
tf VARCHAR(50);
zhmi VARCHAR(50);
totazm varchar(5000);
begin
declare cursor curlzhz is select zm,tfqzh from t_lz_hz order by tfqzh;
open curlzhz;
FETCH NEXT FROM curlzhz INTO @zhmi,@tf;

WHILE (@@fetch_status=0)
begin
declare cursor cursyqnew is select l from t_fc_syq_new where substr(fh,1,12)=tf and l<>zhmi;
totazm=totazm+tf;
loop
totazm=totazm','+l;
end loop;
update t_lz_hz set zm=totazm where tfqzh=tf;
commit;
totalzm='';
close cursyqnew;
end;
close curlzhz;
end generateLouName;



PROCEDURE DB_SJCJ.GENERATELOUNAME 编译错误

错误:PLS-00103: 出现符号 "FETCH"在需要下列之一时:
begin function package
pragma procedure subtype type use <an identifier>
<a double-quoted delimited-identifier> form current cursor
行:8
文本:FETCH NEXT FROM curlzhz INTO @zhmi,@tf;


出现这个错误怎么办?
...全文
评论 6
收藏 已收藏
分享
返回顶部
wch_212
基础和管理 17,377 成员 95,111 内容