南归北隐
2019-09-27 19:02
采纳率: 42.9%
浏览 240
已采纳

mysql存储过程遍历删除语句报错帮忙看看

语句

CREATE PROCEDURE delete_matches ( IN id INTEGER ) BEGIN
DELETE 
FROM
    lconstructionproject 
WHERE
    pid = id;

END  

call delete_matches('1');

报错

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 'call delete_matches('1')' at line 10

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • qq_25314053 2019-09-27 23:06
    已采纳

    2个问题,END要加上分号,输入值是INTEGER所以不加 ' '
    CREATE PROCEDURE delete_matches ( IN id INTEGER )
    BEGIN
    DELETE
    FROM
    lconstructionproject
    WHERE
    pid = id
    END;  

    call delete_matches(1);

    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题