问题
I need to create an event inside a procedure, I read somewhere that it's possible but I don't know the syntax. I'm trying:
CREATE PROCEDURE DUMMY_PROCEDURE()
BEGIN
CREATE event e on schedule every 1 second DO
INSERT INTO test.t values (current_timestamp);
END;
But it throws:
Any ideas on how to do this?, thanks for reading.
'#1576 - Recursion of EVENT DDL statements is forbidden when body is present
Edit1:
The reason I want to create an event within an event procedure is because it acts as an expiration date, so the function is executed an event with very specific parameters is also created, so when the expiration date arrives, automatically bank makes a particular action. Understand?
回答1:
You can't create an event inside procedure body. See this http://www.peregrinesalon.com/wp-content/uploads/2009/03/mysql-stored-procedures.pdf
来源:https://stackoverflow.com/questions/8357174/create-an-event-inside-a-procedure-sql