0

My MySQL statement:

CREATE PROCEDURE latest_procedure() BEGIN
DELETE ac.* FROM s_articles_categories AS ac JOIN s_articles AS a ON ac.articleID = a.id WHERE ac.categoryID = 38;
END

I am getting the following error:

#1064 - 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 '' at line 2 

Any suggestions as to the reason(s) of this error?

0

1 Answer 1

1

You are missing delimiter and need to close the end

delimiter //

CREATE PROCEDURE latest_procedure() BEGIN
DELETE ac.* FROM s_articles_categories AS ac JOIN s_articles AS a ON ac.articleID = a.id WHERE ac.categoryID = 38;
END;//

delimiter ;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.