谁能明白我为什么会得到:
[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 '//
DELIMITER' at line 11
对于以下代码段:
DELIMITER //
DROP PROCEDURE
IF EXISTS nested_test//
CREATE PROCEDURE nested_test()
BEGIN
DECLARE a INT;
SET a = 1;
SELECT a;
BEGIN
DECLARE b INT;
SET b = 2;
SELECT b;
END;
END//
DELIMITER;
这是我实际编写的内容的简化版本,它带来了完全相同的错误。在我添加嵌套的 BEGIN END 块之前,一切都很好。它在 phpMyAdmin 上运行良好,但在 Navicat 9 上失败