IF statement - syntax issue ?
Posted by:
A Clarkson
Date: February 17, 2011 04:36AM
Hi all,
I'm having issues with the following IF statement in MySQL 5.5.9 - it's telling me there is an error in the syntax. I want to execute this every minute as a scheduled event procedure (although that's not really relevant to the syntax issue).
What am I doing wrong here ?
if ( dayname(now()) = "Monday" or dayname(now()) = "Tuesday" or dayname(now()) = "Wednesday" or dayname(now()) = "Thursday" or dayname(now()) = "Friday" ) and time_format(current_time(),'%H:%i') ='07:30'
then
select dayname(now()),time_format(current_time(),'%H:%i');
update jos_menu set published=0, home=0 where alias ='india';
update jos_menu set published=0, home=0 where alias ='home';
update jos_menu set published=0, home=0 where alias ='emea';
update jos_menu set published=1, home=1 where alias ='limbo';
update jos_menu set published=0, home=0 where alias ='sunday';
end if;
Many Thanks
Subject
Written By
Posted
IF statement - syntax issue ?
February 17, 2011 04:36AM
February 17, 2011 06:47AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.