J. G.
J. G.

Reputation: 1832

Mysql syntax error with stored procedure (workbench)

Ok so this is my current code

delimiter //

Create procedure addFish(in_color varchar(45), in_pattern varchar(45))
BEGIN
INSERT INTO ZenFish
(`ZenColorsID`,`Pattern`, `Hatched`     )
VALUES
(
(select idZenColors from ZenColors where ColorName = in_color),
in_pattern,
CURRENT_TIMESTAMP()
);
END

delimiter ;

It does NOTHING when I press run in mysql workbench. Before I added the delimiter marks it at least gave me a syntax error. Adding delimiter lines seems to be what everyone else on stackoverflow was told to do with this problem, so I did it and now... just nothing happens when I press run, or select it all and press run, or run this statement. De nada.

Upvotes: 0

Views: 1209

Answers (1)

Mahesh Madushanka
Mahesh Madushanka

Reputation: 2998

you have small issue on your end tag

delimiter $$

Create procedure addFish(in_color varchar(45), in_pattern varchar(45))
BEGIN
INSERT INTO ZenFish
(`ZenColorsID`,`Pattern`, `Hatched`     )
VALUES
(
(select idZenColors from ZenColors where ColorName = in_color),
in_pattern,
CURRENT_TIMESTAMP()
);
END$$

delimiter ;

try this

Upvotes: 3

Related Questions