gpt4 book ai didi

mysql - 错误 1064 (42000) : You have an error in your SQL syntax;

转载 作者:行者123 更新时间:2023-11-29 13:20:33 25 4
gpt4 key购买 nike

创建这个新存储过程时,我在命令行中收到以下错误,但我似乎无法弄清楚是什么原因造成的。表中的所有列名称及其数据类型均已验证正确。

错误:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE PROCEDURE sproc_CreateFullRewardCardPass (
IN MerchantNo INT (11),
IN Me' at line 2

这是脚本:

DELIMITER //
DROP PROCEDURE IF EXISTS sproc_CreateFullRewardCardPass
CREATE PROCEDURE sproc_CreateFullRewardCardPass (
IN MerchantNo INT (11),
IN MerchantStoreName VARCHAR (200),
IN RewardCardType VARCHAR (20),
IN RewardCardId BIGINT (20),
IN RewardCardTitle VARCHAR (50),
IN RewardCardDescription VARCHAR (100),
IN MerchantCharity VARCHAR (200),
IN MerchantDonation DOUBLE,
IN RewardCardExpDate DATE,
IN RewardCardreateDate DATE,
IN RewardCardStatus INT (1),
IN RewardCardPassHeader VARCHAR (50)
);

BEGIN


DECLARE RCpasstypeidenitifier TEXT;
DECLARE RCpassformatversion INT (2);
DECLARE RCpassteamidentifier VARCHAR (30);
DECLARE RCpassserialnumber VARCHAR (100);
DECLARE RCpassbackgroundcolor VARCHAR (16);
DECLARE RCpassvisual_1xicon TEXT;
DECLARE RCpassvisual_2xicon TEXT;
DECLARE RCpassvisual_logo TEXT;
DECLARE RCpasssecondary_label1 VARCHAR (50);
DECLARE RCpasssecondary_value1 VARCHAR (50);
DECLARE RCpassaux_label1 VARCHAR (50);
DECLARE RCpassbarcode_type VARCHAR (20);
DECLARE RCpassbarcode_encoding VARCHAR (200);
DECLARE RCpassback_value1 TEXT;
DECLARE RewardCardTitle TEXT;

SET RCpasssecondary_value1 = 'expires';
SET RCpassbarcode_type = 'PKBarcodeFormatQR';
SET RCpassbarcode_encoding = 'iso-8859-1';
SET RCpassback_value1 = 'RCpassback_value1';


/* CREATE FULL REWARD CARD PASS */
INSERT INTO `mcp_passes_merchants` (
passtype,
`status`,
merchantid,
rewardid,
merchantname,
meta_description,
passtypeidentifier,
formatversion,
teamidentifier,
serialnumber,
backgroundcolor,
visual_1xicon,
visual_2xicon,
visual_logo,
visual_text,
meta_expdate,
primary_label,
primary_value,
secondary_label1,
secondary_value1,
aux_label1,
aux_value1,
barcode_value,
barcode_text,
barcode_type,
barcode_encoding,
datecreated,
nonprofit,
donation,
back_label1,
back_value1);

VALUES (
RewardCardType,
RewardCardStatus,
MerchantNo,
RewardCardId,
MerchantStoreName,
RewardCardTitle,
RCpasstypeidenitifier,
RCpassformatversion,
RCpassteamidentifier,
RCpassserialnumber,
RCpassbackgroundcolor,
RCpassvisual_1xicon,
RCpassvisual_2xicon,
RCpassvisual_logo,
MerchantStoreName,
RewardCardExpDate,
RewardCardPassHeader,
RewardCardTitle,
RCpasssecondary_label1,
RCpasssecondary_value1,
RCpassaux_label1,
RewardCardId,
RewardCardId,
RewardCardId,
RCpassbarcode_type,
RCpassbarcode_encoding,
RewardCardCreateDate,
MerchantCharity,
MerchantDonation,
RewardCardDescription,
RCpassback_value1);

END//
DELIMITER ;

最佳答案

您需要以分隔符结束每个语句。在您的情况下,它是 //。在 drop 语句之后添加此内容

DROP PROCEDURE IF EXISTS sproc_CreateFullRewardCardPass //
here -------------------------^

关于mysql - 错误 1064 (42000) : You have an error in your SQL syntax;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20923837/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com