u010713523 2013-09-27 06:03
浏览 1099

navcat中创建存储过程遇到的不识别的问题

本人是个菜鸟,在navicat中创建存储过程时遇到的问题

CREATE procedure CountLayer  (in node int,out result int)
begin  
    declare result,lft1, rgt1 int;
    if exists(select Node_id from Tree where Node_id = node); 
    begin 
        select lft1 = Lft,rgt1 = Rgt from Tree where( Node_id = node);
        select result = count(*) from Tree where Lft <= lft1 and Rgt >= rgt1;  
    end  
    return result  
end 
GO

然后错误

[SQL] CREATE procedure CountLayer  (in node int,out result int)
begin  
    declare result,lft1, rgt1 int;
    if exists(select Node_id from Tree where Node_id = node); 
    begin 
        select lft1 = Lft,rgt1 = Rgt from Tree where( Node_id = node);
        select result = count(*) from Tree where Lft <= lft1 and Rgt >= rgt1;  
    end  
    return result  
end 
GO

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; 
    begin 
        select lft1 = Lft,rgt1 = Rgt from Tree where( Node_id = ' at line 4

跪求跪求大神解决。。。

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 我想在一个软件里添加一个优惠弹窗,应该怎么写代码
    • ¥15 fluent的在模拟压强时使用希望得到一些建议
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 Web.config连不上数据库
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流