3

I have an error in my stored procedure using (mysql 5.6). and I am using Workbench 6.3 CE. My code is as below

DELIMITER //            (this line shows error)why??
CREATE PROCEDURE Demo(in v_id int)
BEGIN

select name from student where id=v_id;

END//

delimiter;
1
  • Try DELIMITER // CREATE PROCEDURE Demo(in v_id int) BEGIN SELECT name from student where id=v_id; END // DELIMITER;
    – Gaurav Lad
    Dec 15, 2015 at 4:00

2 Answers 2

7

Your problem is not the line

DELIMITER //

but the line

delimiter;

You've left out a space; it should be

delimiter ;
0

Try

DELIMITER $$
CREATE PROCEDURE Demo(in v_id int)
BEGIN
SELECT name from student where id=v_id;
END $$
DELIMITER ;
1
  • Your exact statement returns the exact same error as mine. There should be something wrong with my version or something. Is this DELIMITER statement is usable for MySQL?
    – Baran Yeni
    May 13, 2021 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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