java吧 关注:1,212,644贴子:12,655,704
  • 1回复贴,共1

【求助】关于存储过程字段拼接赋值给变量

只看楼主收藏回复

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;


来自iPhone客户端1楼2014-05-29 14:12回复
    求解


    来自iPhone客户端2楼2014-05-29 14:13
    回复