MySQL Forums
Forum List  »  Stored Procedures

Question about an event in a procedure
Posted by: To bi
Date: January 23, 2012 08:53AM

Hey community!

I have a little problem with my sql code...
I need to create an event dynamic ba a procedure!

So I have tested this code:

DROP PROCEDURE if exists eventProc //
CREATE PROCEDURE eventProc()
BEGIN
DECLARE dauer VARCHAR(50);

SELECT parameter.wert INTO dauer
FROM parameter
WHERE parameter.name = 'lohndauer';


DROP EVENT `newEvent`;
CREATE EVENT `newEvent` ON SCHEDULE EVERY dauer STARTS '2012-01-20 10:00:00' ON COMPLETION NOT PRESERVE ENABLE DO CALL myProc();

END;
//




I get this message but I don't know why... maybe anybody can help me!

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STARTS '2012-01-20 10:00:00' ON COMPLETION NOT PRESERVE ENABLE DO CALL myProc();' at line 11



Thanks a lot!

Options: ReplyQuote


Subject
Views
Written By
Posted
Question about an event in a procedure
1893
January 23, 2012 08:53AM
912
January 24, 2012 03:43AM
879
January 25, 2012 02:31AM


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.