Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. DELIMITER $$
  2. CREATE PROCEDURE survey_task()
  3. BEGIN
  4.  
  5. select tel_number, text_message, id INTO @t_number, @t_message, @t_id from incoming_messages where t_status = 0 limit 1;
  6.  
  7. insert into surveyed_lot(telephone_number, survey_answer,date_of_insert )
  8. values(@t_number, @t_message,now());
  9.  
  10. UPDATE incoming_messages SET t_status = 1 WHERE id = @t_id;
  11.  
  12. END $$
  13. DELIMITER ;
  14.  
  15. CREATE EVENT survey_processor_1
  16. ON SCHEDULE EVERY 10 SECOND
  17. DO
  18. call survey_task();
  19.  
  20. CREATE EVENT survey_processor_2
  21. ON SCHEDULE EVERY 10 SECOND
  22. DO
  23. call survey_task();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement