Skip navigation links

MySQL Forums :: MySQL Query Analyzer :: trouble with create even


Advanced Search

trouble with create even
Posted by: madi madi ()
Date: December 21, 2011 05:23AM

I have written these codes in mysql, all the codes execute with out any problem but when I add "CREATE EVENT madi ON SCHEDULE EVERY 1 DAY DO " this query executes wrongly and DELETE codes run sooner than INSERT code, and also the event doesnt work regulary. please help me with this problem.
INSERT INTO thanksmsg1( thanksid1, userid, sendername, recivername,reciveremail,
text, attach, score, cost, sendyear, sendmonth, sendday, subject,
tempid, draftid )
SELECT thanksid2, userid, sendername, recivername, reciveremail,
text, attach, score, cost, sendyear, sendmonth, sendday, subject,
tempid, draftid
FROM thanksmsg2
WHERE sendyear=YEAR(CURDATE())
AND sendmonth=MONTH(CURDATE())
AND sendday=DAY(CURDATE())
AND userid IS NOT NULL;

DELETE FROM thanksmsg2
WHERE sendyear=YEAR(CURDATE())
AND sendmonth=MONTH(CURDATE())
AND sendday=DAY(CURDATE());

Options: ReplyQuote


Subject Views Written By Posted
trouble with create even 797 madi madi 12/21/2011 05:23AM


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.