Define routines containing semicolons.
Section: stored procedures and functions
Change the statement delimiter
sql
sql
DELIMITER $$
CREATE PROCEDURE get_user_by_email(IN p_email VARCHAR(255))
BEGIN
SELECT id, email, full_name
FROM users
WHERE email = p_email;
END $$
DELIMITER ;Explanation
Changing the delimiter is the standard pattern when creating stored procedures in the mysql client.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing stored procedures and functions