使用navicat,问题是我想创建一个事件,命名它,安排它,并填写事件以及以后执行的指令。我有代码,当我运行查询来创建事件时,它只会将第一行指令集粘贴到事件计划中。这里的例子是代码......
CREATE EVENT `replaceTents` ON SCHEDULE EVERY 1 HOUR COMMENT 'Changes Tents to Map Items' DO
UPDATE `Object_DATA` SET `Classname` = 'Land_Campfire_burning' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar2oz"],[2]],[[],[]]]';
UPDATE `Object_DATA` SET `Classname` = 'WarfareBunkerSign' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar2oz"],[2]],[[],[]]]';
UPDATE `Object_DATA` SET `Classname` = 'Land_Fire_barrel_burning' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar10oz"],[2]],[[],[]]]';
UPDATE `Object_DATA` SET `Classname` = 'HeliHCivil' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar10oz"],[5]],[[],[]]]';
UPDATE `Object_DATA` SET `Classname` = 'Land_Ind_TankSmall' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar10oz"],[9]],[[],[]]]';
UPDATE `Object_DATA` SET `Classname` = 'Land_Ind_IlluminantTower' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemBriefcase100oz"],[1]],[[],[]]]';
UPDATE `Object_DATA` SET `Classname` = 'WarfareBAirport' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemBriefcase100oz"],[3]],[[],[]]]';
所以问题是这是唯一一个显示在事件中保存的因为它在列表中的第一个,我将如何继续使用SQL将整个集合打印到单个事件计划中?
UPDATE `Object_DATA` SET `Classname` = 'Land_Campfire_burning' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar2oz"],[2]],[[],[]]]';
提前致谢..
答案 0 :(得分:0)
我认为您需要使用DO BEGIN
的最后一个示例中显示的END
... {{1}}
编辑1:另外,如http://www.sitepoint.com/how-to-create-mysql-events/所述:
与存储例程一样,您可以使用BEGIN和END关键字在DO子句中使用复合语句语法