gpt4 book ai didi

mysql - 尝试插入时出现 SQL 错误

转载 作者:行者123 更新时间:2023-11-29 18:44:06 24 4
gpt4 key购买 nike

一直在尝试创建一个巨大的 SQL(大约 200 个查询),以便快速将数据插入数据库,但是由于某种原因,我收到 SQL 错误,但不确定是什么原因造成的。

错误:

SQL Error (1064): 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 '6', '1', '21', '4128', '8388608', '1', '0', '0', '0', '0', '0', '0', '0', '0', at line 8

这是我的代码的一部分:

SET @ID = 2710601;
SET @DID = 420591;

INSERT INTO item_template (entry, class, subclass, name, displayid, Quality, BuyCount, InventoryType, Flags, FlagsExtra, maxcount, ContainerSlots, BuyPrice, SellPrice, dmg_type1, dmg_type2, dmg_min1, dmg_min2, dmg_max1, dmg_max2, delay, ammo_type, RangedModRange, itemset, bonding, block, MaxDurability, sheath, holy_res, frost_res, fire_res, shadow_res, nature_res, arcane_res, socketColor_1, socketColor_2, socketColor_3, socketContent_1, socketContent_2, socketContent_3, socketBonus, GemProperties, spellid_1, spellid_2, spellid_3, spellid_4, spellid_5, spelltrigger_1, spelltrigger_2, spelltrigger_3, spelltrigger_4, spelltrigger_5, spellcharges_1, spellcharges_2, spellcharges_3, spellcharges_4, spellcharges_5, spellppmRate_1, spellppmRate_2, spellppmRate_3, spellppmRate_4, spellppmRate_5, spellcooldown_1, spellcooldown_2, spellcooldown_3, spellcooldown_4, spellcooldown_5, spellcategory_1, spellcategory_2, spellcategory_3, spellcategory_4, spellcategory_5, spellcategorycooldown_1, spellcategorycooldown_2, spellcategorycooldown_3, spellcategorycooldown_4, spellcategorycooldown_5, startquest, material, randomproperty, randomsuffix, area, map, disenchantid, pagetext, languageid, pagematerial, foodtype, lockid, holidayid, BagFamily, ArmorDamageModifier, duration, ItemLimitCategory, minMoneyLoot, maxMoneyLoot, flagscustom, TotemCategory, AllowableRace, AllowableClass, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, RequiredDisenchantSkill, StatsCount, stat_type1, stat_type2, stat_type3, stat_type4, stat_type5, stat_type6, stat_type7, stat_type8, stat_type9, stat_type10, stat_value1, stat_value2, stat_value3, stat_value4, stat_value5, stat_value6, stat_value7, stat_value8, stat_value9, stat_value10, ScalingStatDistribution, ScalingStatValue) VALUES
(@ID+13, '2', '10', 'Artifact Weapon', @DID+13, '6', '1', '21', '4128', '8388608', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1000', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')

My full SQL you could find on PasteBin.

不知道是什么原因造成的,因为后面的“6”完全没问题(也许与@Defines有关?我确实尝试过将它们设置为:= (VALUE) 但有相同的结果。

感谢任何帮助。

最佳答案

您是否尝试将其减少到只有您收到错误的行的版本。

SET @ID = 2710601;
SET @DID = 420591;

INSERT INTO item_template (entry, class, subclass, name, displayid, Quality, BuyCount, InventoryType, Flags, FlagsExtra, maxcount, ContainerSlots, BuyPrice, SellPrice, dmg_type1, dmg_type2, dmg_min1, dmg_min2, dmg_max1, dmg_max2, delay, ammo_type, RangedModRange, itemset, bonding, block, MaxDurability, sheath, holy_res, frost_res, fire_res, shadow_res, nature_res, arcane_res, socketColor_1, socketColor_2, socketColor_3, socketContent_1, socketContent_2, socketContent_3, socketBonus, GemProperties, spellid_1, spellid_2, spellid_3, spellid_4, spellid_5, spelltrigger_1, spelltrigger_2, spelltrigger_3, spelltrigger_4, spelltrigger_5, spellcharges_1, spellcharges_2, spellcharges_3, spellcharges_4, spellcharges_5, spellppmRate_1, spellppmRate_2, spellppmRate_3, spellppmRate_4, spellppmRate_5, spellcooldown_1, spellcooldown_2, spellcooldown_3, spellcooldown_4, spellcooldown_5, spellcategory_1, spellcategory_2, spellcategory_3, spellcategory_4, spellcategory_5, spellcategorycooldown_1, spellcategorycooldown_2, spellcategorycooldown_3, spellcategorycooldown_4, spellcategorycooldown_5, startquest, material, randomproperty, randomsuffix, area, map, disenchantid, pagetext, languageid, pagematerial, foodtype, lockid, holidayid, BagFamily, ArmorDamageModifier, duration, ItemLimitCategory, minMoneyLoot, maxMoneyLoot, flagscustom, TotemCategory, AllowableRace, AllowableClass, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, RequiredDisenchantSkill, StatsCount, stat_type1, stat_type2, stat_type3, stat_type4, stat_type5, stat_type6, stat_type7, stat_type8, stat_type9, stat_type10, stat_value1, stat_value2, stat_value3, stat_value4, stat_value5, stat_value6, stat_value7, stat_value8, stat_value9, stat_value10, ScalingStatDistribution, ScalingStatValue) VALUES
(@ID+7, '2', '10', 'Artifact Weapon', @DID+7 '6', '1', '21', '4128', '8388608', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1000', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');

编辑:您缺少 @DID+7 和 '6' 之间的逗号:

@DID+7  '6'

EDIT2:你如何自己解决这个问题?使用bisection method隔离有问题的数据。

关于mysql - 尝试插入时出现 SQL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44754792/

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