2017-04-10 76 views
-4

我試圖使用PHP的Web界面,用於MySQL創建MySQL中的存儲過程:MySQL錯誤#1064,在存儲過程中DELETE語句

DELIMITER \\ 
CREATE PROCEDURE Remove_Product (IN id INT) 
{ 
    BEGIN 
    DELETE Product WHERE ProductId=id; 
    END \\ 
} 
DELIMITER ; 

,但我堅持錯誤#1064:

Error: (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 WHERE ProductId=id; at line 3.

如何解決錯誤?

回答

0

您的語法錯誤。它應該是

DELETE FROM Product WHERE ProductId=id; 

FROM不是可選的。請參閱the manual on the DELETE syntax

+0

非常感謝。這工作。當涉及到連接時,我認爲「發件人」是必要的 – Ram