0
我試圖創建一個使用HeidiSQL在MariaDB(10.1.17)中插入數據的過程,但語句失敗,出現錯誤「SQL錯誤(1064)您的SQL語法;請查看對應於您的MariaDB的服務器版本在第11" 行「創建過程」語句中的錯誤
DELIMITER $$
CREATE PROCEDURE `uspaddpost`(IN `_siteparseid` INT, IN `_user`
VARCHAR(255), IN `_post` TEXT)
BEGIN
DECLARE _userid INT;
DECLARE _siteid INT;
SELECT `SiteID` INTO _siteid FROM tblsiteparse WHERE `SiteParseID` = _siteparseID LIMIT 1;
IF NOT EXISTS(SELECT `UserID` FROM tblusers WHERE `User` = _user) THEN
INSERT INTO tblusers (`UserID`, `SiteID`) VALUES (_user, _siteid);
SELECT `UserID` INTO _userid FROM tblusers WHERE `User` = _user;
INSERT INTO tblposts (`UserID`,`SiteParseID`, `Post`) VALUES (_userid, _siteparseid, _post);
END$$
DELIMITER ;