I am using mysql 5.7 and I have some code which works. But when I try to create procedure with the code, it reports error [1064] [42000]. I try to update the content of an old procedure with my current code and it works. Does someone know why this happens?

Here is how I try to create a procedure.

create procedure dispatch_remaintimecal_12division (in lgtid VARCHAR(20))
my code;
  • Show the DELIMITER statements, too.
    – Rick James
    Jan 19, 2019 at 18:55
  • @Rick James After I add the DELIMITER statements, it works. I am not sure why is that.
    – Deepleeqe
    Jan 20, 2019 at 6:39
  • DELIMITER is part of the syntax of creating stored routines.
    – Rick James
    Jan 20, 2019 at 18:57

1 Answer 1


ERROR 1064 (42000): states that "You have an error in your SQL syntax". Can you specify what is being executed as 'my code'. That is where SQL syntax appears to be going wrong. Make sure you are within the right database before calling your procedure.

eg: USE dbname; 
  • My code is quite long. The error message is “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 741“ which is the last line in my code and it is "and x.item = y.item;".
    – Deepleeqe
    Jan 19, 2019 at 8:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.