I have following store procedure. It is give me some error
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 ;
It is giving me missing semicolon error
. Don't know Why this error is getting. Can someone help me?
Try like this:
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 ;
There's only one BEGIN
and two END
s, remove the 2nd END
and you should be fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With