试图制作一个巨大的SQL(大约200个查询)以便快速将数据插入数据库但是由于某些原因我得到了SQL错误但不确定是什么导致它。
错误:
SQL错误(1064):您的SQL语法中有错误;查看与MySQL服务器版本对应的手册,以便在第8行
'6', '1', '21', '4128', '8388608', '1', '0', '0', '0', '0', '0', '0', '0', '0',
附近使用正确的语法
以下是我的代码的一部分:
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)
但结果相同。
感谢任何帮助。
答案 0 :(得分:0)
并且您是否尝试将其缩小到只有您遇到错误的行的版本。
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隔离相关数据。