mysql create procedure syntax issue line 1
I get a syntax error on line 1 of t开发者_运维百科he following procedure:
DELIMITER |
CREATE PROCEDURE sp_autocallFillCallQueue
BEGIN
DECLARE maxCalls TINYINT(1);
SELECT autocall_maxCalls INTO maxCalls FROM `options` LIMIT 0,1;
REPEAT
INSERT INTO `callQueue` (`phoneNumber`, 'waiting')
SELECT `phoneNumber` FROM `phoneNumbers` WHERE `accessRestriction` != 'blacklist' && `flagAutocall` = 1;
SET maxCalls = maxCalls - 1;
UNTIL maxCalls = 0
END REPEAT;
END;
|
I am setting the delimiter before and after this. I have a feeling it is something silly (as this is my first mysql stored proc). I'm totally stumped atm though.
FYI, this is the error:
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 'PROCEDURE sp_autocallFillCallQueue
BEGIN
DECLARE @maxCalls TINYINT(1);
SELECT ' at line 1
In order to remove this from the "unanswered" list...
Prediction: You are using version 4.1, but stored procedures didn't become available until version 5.0.
Problem solved!
精彩评论