我在NAVICAT下创建存储过程,代码如下:
create procedure pro_list1
(
in $list_rid bigint(11)
)
begin
select a.eid, a.title as content,c.title as kit,
(
select group_concat(distinct a2.name)
from creator_locals as a2
join creator_contents as b2 on a2.eid = b2.creator_eid and a2.type = 'MAIN' and b2.role = 'OA'
where b2.content_eid = a.eid and a2.language = a.language
) as OA,
(
select group_concat(distinct a3.name)
from creator_locals as a3
join creator_contents as b3 on a3.eid = b3.creator_eid and a3.type = 'MAIN' and b3.role = 'OC'
where b3.content_eid = a.eid and a3.language = a.language
) as OC,
(
select group_concat(performer)
from performer_locals as a1
join performer_contents as b1 on a1.eid = b1.performer_eid and a1.type = 'MAIN'
where b1.content_eid = a.eid and a1.language = a.language
) as performer,
(
select group_concat(gender)
from performers as a1
join performer_contents as b1 on a1.eid = b1.performer_eid
where b1.content_eid = a.eid
) as performer_type,
c1.published,
(
select group_concat(distinct a2.name)
from meta_dictionary as a2
join content_meta_maps as b2 on a2.element_group = b2.relate_group and a2.element_code = b2.relate_code and a2.element_group = 'GENRE'
where b2.content_id = a.eid
) as genre
from content_locals as a
join contents as b on a.language = 'KR' and a.eid = b.eid and (b.mp3_id  is null or b.mp3_id = 0)
join kit_locals as c on b.kit_eid = c.eid and a.language = c.language
join kits as c1 on c.eid = c1.eid
join list_details as d
on a.eid=d.content_eid and d.list_rid=$list_rid and d.content_eid is not null;
end但是总是提示incorrect routine name'',以上这段代码在命令行下执行能正确显示,但是在NAVICAT下就不行,大家有用过NAVICAT的能不能描述一下存储过程的使用啊

解决方案 »

  1.   

    你直接用这一句看如何? 逐步缩小错误的范围。create procedure pro_list1(in $list_rid bigint(11))
    begin
    select 1;
    end
      

  2.   

    我试了下,你报incorrect routine name 的错,是因为存储过程名后面有空格
    另外,不知道你建立存储过程的方式是否正确
    步骤是这样的:
    在“Definition”项里面填存储过程的主体部分即可(begin ... end这部分),
    然后在里面的“Parameter”里面填参数,你这里填 "in $list_rid bigint(11)",
    然后点工具栏上的“save”,这时填你的存储过程名,你这里填 "pro_list1"(要注意名字后面没空格哦)