mysql 報錯1064 - You have an error in your SQL syntax;
數據庫版本:mysql5.7;系統版本:CentOS Linux7.5
場景:
執行下面的存儲過程
CREATE PROCEDURE pro_dw_gs()
BEGIN
select * from ods_ban_nnn;
END
報錯如下:
CREATE PROCEDURE pro_dw_gs()
BEGIN
select * from ods_ban_nnn
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 '' at line 3
時間: 0.001s
解決:
在存儲過程前後添加DELIMITER //和// DELIMITER ;
正確的存儲過程爲:
DELIMITER //
CREATE PROCEDURE pro_test_nnn()
BEGIN
select * from ods_ban_nnn;
END
//
DELIMITER ;