【mysql報錯】1064 - You have an error in your SQL syntax;

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 ;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章