在一个过程中创建一个事件--SQL [英] Create an event inside a procedure - SQL
问题描述
我需要在一个过程中创建一个事件,我读到某个地方可能,但是我不知道语法。我正在尝试:
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;
但它会抛出:
任何想法关于怎么做,谢谢阅读。
Any ideas on how to do this?, thanks for reading.
'#1576 - 当身体出现时,EVENT DDL语句的递归被禁止
'#1576 - Recursion of EVENT DDL statements is forbidden when body is present
编辑1:
我想在事件过程中创建一个事件的原因是因为它作为一个到期日期,因此该函数执行一个非常具体的事件参数也被创建,所以当到期日到达时,自动银行做出特定的动作。了解?
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?
推荐答案
您不能在程序体内创建一个事件。请参阅此 http://www.peregrinesalon.com /wp-content/uploads/2009/03/mysql-stored-procedures.pdf
You can't create an event inside procedure body. See this http://www.peregrinesalon.com/wp-content/uploads/2009/03/mysql-stored-procedures.pdf
这篇关于在一个过程中创建一个事件--SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!