Wednesday, 15 August 2012

php - Syntax error creating event; query works fine standalone -


I want to create an event on the MySQL database. I get this error when I run a query that creates an Evolution Schedule:

  1064 - There is an error in your SQL syntax;  

Wired thing is that when I run a query inside the event schedule, then it runs fine without any errors. I errors:

This code is used by I'm doing

  CREATE DEFINER = 'Route @' localhost 'EVENT' updates every 20 minutes 'updates' 2015-01-01 00:01:00 on completeness '' Not enabled '' score 'STT `goals' = '0' where` target` & gt; '0' and '% no goals%' or `` like a target% '% NG%' like 'PROCESS_DESC' or `% target 0% 'like`% PROCESS_DESC'); END $ $  

Here's what you want to have this delimiter content dirty and confusing .

DELIMITER $$ create DEFINER = `Route '@' Localhost 'Event' Update Updates' on every 20 minute start '2015-01-01 00:01: 00' do not secure perfection '' Score '' SET goals' = '0' where 'target'> gt; 0 'and (`% no goals%' or 'ng%' like` PROCESS_DESC 'or'% target 0% 'like' processes_desc '); END $$

Did you notice that your event will only run once, right? It says that on completion not .

If you want to stay around the event and you do not do this DROP , then instead

No comments:

Post a Comment