Mysql stored procedure problem

CREATE PROCEDURE test ()
BEGIN
update vmc_preselling_activity SET last_modify = now () WHERE activity_id = "1818;
END;

ERROR 1064 (42000): 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 "END" at line 1

)

guidance?

Sep.17,2021

The

conjecture is that because the default delimiter for mysql is [;], the compiler reads the statement to the first [;] as the end of the BEGIN section and does not match to the END.

one way is to change the default delimiter before CREATE, such as
DELIMITER / /;
and then change END; to END//.
finally change the delimiter back:
DELIMITER; / /

Menu