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 关于#python#的问题:求帮写python代码
    • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?