以下配置运行两个存储过程:
/*!50106 set global event_scheduler = 1*/;
/*Table structure for table `notification` */
DROP TABLE IF EXISTS `notification`;
CREATE TABLE `notification` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`mydate` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=INNODB;
/*Table structure for table `notificationStatus` */
DROP TABLE IF EXISTS `notificationStatus`;
CREATE TABLE `notificationStatus` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`mydate` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=INNODB;
/* Event structure for event `EVENT_NOTIFICATION` */
/*!50106 DROP EVENT IF EXISTS `EVENT_NOTIFICATION`*/;
DELIMITER $$
/*!50106 CREATE EVENT `EVENT_NOTIFICATION` ON SCHEDULE EVERY 5 SECOND
STARTS '2013-10-12 00:00:00' ON COMPLETION NOT PRESERVE ENABLE
DO
BEGIN
CALL `sp_Notification`();
CALL `sp_notificationStatus`();
END */$$
DELIMITER ;
/* Procedure structure for procedure `sp_Notification` */
/*!50003 DROP PROCEDURE IF EXISTS `sp_Notification` */;
DELIMITER $$
/*!50003 CREATE PROCEDURE `sp_Notification`()
BEGIN
INSERT INTO `notification` (`mydate`) VALUES (NOW());
END */$$
DELIMITER ;
/* Procedure structure for procedure `sp_notificationStatus` */
/*!50003 DROP PROCEDURE IF EXISTS `sp_notificationStatus` */;
DELIMITER $$
/*!50003 CREATE PROCEDURE `sp_notificationStatus`()
BEGIN
INSERT INTO `notificationStatus` (`mydate`) VALUES (NOW());
END */$$
DELIMITER ;