17,377
社区成员
发帖
与我相关
我的任务
分享
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;