Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER $$
- CREATE PROCEDURE survey_task()
- BEGIN
- select tel_number, text_message, id INTO @t_number, @t_message, @t_id from incoming_messages where t_status = 0 limit 1;
- insert into surveyed_lot(telephone_number, survey_answer,date_of_insert )
- values(@t_number, @t_message,now());
- UPDATE incoming_messages SET t_status = 1 WHERE id = @t_id;
- END $$
- DELIMITER ;
- CREATE EVENT survey_processor_1
- ON SCHEDULE EVERY 10 SECOND
- DO
- call survey_task();
- CREATE EVENT survey_processor_2
- ON SCHEDULE EVERY 10 SECOND
- DO
- call survey_task();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement