Arun nagar
Arun nagar

Reputation: 176

syntax error: 'delimiter ' is not valid input here

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;

Upvotes: 3

Views: 6953

Answers (2)

Gaurav Lad
Gaurav Lad

Reputation: 1808

Try

DELIMITER $$
CREATE PROCEDURE Demo(in v_id int)
BEGIN
SELECT name from student where id=v_id;
END $$
DELIMITER ;

Upvotes: 0

Darwin von Corax
Darwin von Corax

Reputation: 5246

Your problem is not the line

DELIMITER //

but the line

delimiter;

You've left out a space; it should be

delimiter ;

Upvotes: 7

Related Questions