我有以下商店程序。它给了我一些错误
DROP procedure IF exists getQueueMessage;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `getQueueMessage`(msg varchar(100))
BEGIN
SELECT `Name` FROM queues WHERE Id IN (
SELECT PhysicalQueueId FROM indexqueuemaps WHERE ConditionFieldValue = msg)
END
END$$
DELIMITER ;
它给了我missing semicolon error
。不知道为什么会出现这个错误。有人能帮助我吗?
答案 0 :(得分:23)
试试这样:
DROP procedure IF exists getQueueMessage;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `getQueueMessage`(msg varchar(100))
BEGIN
SELECT `Name` FROM queues WHERE Id IN (
SELECT PhysicalQueueId FROM indexqueuemaps WHERE ConditionFieldValue = msg);
END$$
DELIMITER ;
答案 1 :(得分:4)
只有一个BEGIN
和两个END
,删除第二个END
,你应该没问题。
答案 2 :(得分:-3)
将root
@ localhost
替换为root @ localhost