chnet
chnet

Reputation: 2033

mysql create procedure script

I am a bit confused with mysql create procedure script. My script looks like as follows:

DELIMITER //
DROP PROCEDURE play;
CREATE PROCEDURE play()
BEGIN
insert into hi (name,id)VALUES ('apple','2010');
END
//

It does not insert into table hi.

Upvotes: 1

Views: 2598

Answers (2)

user1551590
user1551590

Reputation: 1

use

CALL play();

and I suggest use

DROP PROCEDURE IF EXISTS play()  

instead DROP PROCEDURE play()

Upvotes: 0

DVK
DVK

Reputation: 129403

Your script does not actually execute the play procedure via call command

You need to add

call play

command

Upvotes: 1

Related Questions