CREATE DEFINER=`root`@`localhost` PROCEDURE `GetStateList`(IN _CountryName VARCHAR(255)) BEGIN DECLARE @CCode VARCHAR(50) SET @CCode = (SELECT CountryID from countrylist where CountryName = _CountryName); SELECT @CCode; END
txu3uszq1#
您需要将分隔符重新定义为其他内容(例如: $$ )除 ; . 最后,将限制器复位至 ; . 此外,declare语句中缺少分号:
$$
;
DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `GetStateList`(IN _CountryName VARCHAR(255)) BEGIN DECLARE @CCode VARCHAR(50); -- semicolon was missing here SET @CCode = (SELECT CountryID from countrylist where CountryName = _CountryName); SELECT @CCode; END$$ DELIMITER ;
1条答案
按热度按时间txu3uszq1#
您需要将分隔符重新定义为其他内容(例如:
$$
)除;
. 最后,将限制器复位至;
. 此外,declare语句中缺少分号: