我是MySql的新手。我創建了一個程序:Mysql錯誤1064 while Insert
DELIMITER $$
CREATE PROCEDURE `sampledb`.`InsertSample`
(
IN aName VARCHAR(20),
IN aVersion VARCHAR(10),
IN pName VARCHAR(50),
OUT InsertStatus VARCHAR(30)
)
BEGIN
IF NOT EXISTS(SELECT st.AName FROM sampletable st WHERE st.AName = aName)
INSERT INTO sampletable(AName, AVersion, PName)
VALUES(aName, aVersion, pName)
SET InsertStatus = 'Success'
ELSE
SET InsertStatus = 'Already exists!'
END IF
END$$
DELIMITER $$;
我試過其他方式插入太深:
INSERT INTO sampletable (aName, aVersion, pName)
無論是時間,我得到這個錯誤:
Error Code : 1064
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax ..
我使用MySQL 5.0。 51b-community-nt
可以PLZ提供完整的錯誤消息 – Kshitij 2012-07-06 09:45:29