使用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]],[[],[]]]';
提前致谢..
最佳答案
我相信您需要使用DO BEGIN
... END
,如http://www.sitepoint.com/how-to-create-mysql-events/的最后一个示例所示
编辑1:另外,如http://dev.mysql.com/doc/refman/5.1/en/create-event.html所述:
与存储例程一样,可以通过使用BEGIN和END关键字在DO子句中使用复合语句语法
关于php - 执行第一行后,sql查询停止,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25172464/