该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
create or replace procedure p_dis_cause_sort
as
v_id disq_research_category_two.id%type;
v_typename disq_research_category_two.typename%type;
--v_typename disq_research_category_two.typename%type;
--创建光标
cursor v_cur is
select t.typename as t_typename, t.dis_id as dis_id
from disq_research_category_two t
where t.typename is not null
order by t.dis_id;
c_typename varchar(100);
c_id varchar(32);
begin
open v_cur;
loop
fetch v_cur into v_id,v_typename;
--查看是否有数据
if v_cur%found then
if c_id%found then
c_id := v_id;
if c_id = v_id
--(下面的语句是重点)存储过程在执行下面的问题时出错.. 请问 字段拼接 这样写不对么?
c_typename := c_typename || ';' || v_typename;
else
update disq_orbit v set v.dis_cause_sort = c_typename where v.id = v_id;
end if;
end if;
end if;
exit when v_cur%notfound;
end loop;
close v_cur;
end;