我只是讓我的腳溼存儲過程。據我所看到的教程,這應該是有效的(MySQL的5.5):MySQL:如果存儲過程
CREATE PROCEDURE someFunction (a VARCHAR(256), b VARCHAR(256))
BEGIN
DECLARE haveAllVariables INT;
SET haveAllVariables = 1;
IF a = "" THEN SET haveAllVariables = 0
ELSEIF b = "" THEN SET haveAllVariables = 0
END IF;
但是,它是引發此錯誤:
ERROR 1064 (42000): 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 'ELSEI
F b = "" THEN SET haveAllVariables = 0
哪裏是我的語法錯誤?
謝謝。
謝謝!它應該是顯而易見的! – dotancohen 2012-03-10 20:20:52