Why did this error happened when created EVENT with compound statement?

前端 未结 2 602
生来不讨喜
生来不讨喜 2021-01-28 11:08

From this SO question. I got confused with DELIMITER. And I also tried something like following:

CREATE EVENT test
ON SCHEDULE EVERY 2 MINUTE
DO
BEG         


        
2条回答
  •  悲&欢浪女
    2021-01-28 12:06

    Your answer lies in the docs here 21.1 Defining Stored Programs

    If you use the mysql client program to define a stored program containing semicolon characters, a problem arises. By default, mysql itself recognizes the semicolon as a statement delimiter, so you must redefine the delimiter temporarily to cause mysql to pass the entire stored program definition to the server.

提交回复
热议问题