在过程中创建事件 - SQL
我需要在过程中创建一个事件,我在某处读到这是可能的,但我不知道语法。我正在尝试:
CREATE PROCEDURE DUMMY_PROCEDURE()
BEGIN
CREATE event e on schedule every 1 second DO
INSERT INTO test.t values (current_timestamp);
END;
但它抛出:
关于如何做到这一点的任何想法?感谢您的阅读。
'#1576 - 当主体存在时禁止 EVENT DDL 语句的递归
Edit1:
我想在事件过程中创建事件的原因是因为它充当到期日期,因此执行该函数时还会创建具有非常特定参数的事件,因此当到期日期到来时,银行会自动执行特定操作。理解?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在过程体内创建事件。请参阅此 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