dongzhazhuo0572 2014-08-07 00:34
浏览 37

执行第一行后sql查询停止

Using navicat and the problem is I would like to create an event, name it, schedule it, and fill the event with instruction for carry out at a later date. I have the code and when I run the query to create the event it will only paste the very first line of instruction set into the event schedule. example here is the code......

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]],[[],[]]]';

So the problem is this is the only one that shows up saved inside the event because its first on the list, How would I carry on with the SQL to print the entire set into a single event schedule?

UPDATE `Object_DATA` SET `Classname` = 'Land_Campfire_burning' AND `Inventory` = '[]' WHERE `Classname` = 'TentStorage' AND `Inventory` = '[[[],[]],[["ItemGoldBar2oz"],[2]],[[],[]]]';

Thanks in advance..

  • 写回答

1条回答 默认 最新

  • dongxian8272 2014-08-07 00:38
    关注

    I believe you need to use the DO BEGIN ... END as shown in the last example of http://www.sitepoint.com/how-to-create-mysql-events/

    EDIT 1: Also, as mentioned at http://dev.mysql.com/doc/refman/5.1/en/create-event.html:

    As with stored routines, you can use compound-statement syntax in the DO clause by using the BEGIN and END keywords

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用