The stored procedure does not exist, even after its creation

I am trying to create a mysql stored procedure. I successfully created the procedure using the following code:

delimiter $$ CREATE PROCEDURE `myprocedure` (IN var1 DATE) BEGIN <---code--> END 

AND

 SHOW CREATE PROCEDURE myprocedure 

shows me the procedure that I created.

But a call to myprocedure (2011-05-31);

shows the following error

 #1305 - PROCEDURE db.myprocedure does not exist 

db is the database where I created the procedure

What mistake am I making?

Can someone help me with this?

+8
database mysql stored-procedures stored-functions
source share
1 answer

please check the following example, paying particular attention to using delimiters and quoting input date parameters.

 drop procedure if exists my_procedure; delimiter # create procedure my_procedure ( in p_start_date date ) begin -- do something... select p_start_date as start_date; -- end of sql statement end# -- end of stored procedure block delimiter ; -- switch delimiters again call my_procedure('2011-01-31'); +------------+ | start_date | +------------+ | 2011-01-31 | +------------+ 1 row in set (0.00 sec) 
+4
source share

All Articles