I’m having issues in Mysql 5.0 passing in a date parameter, I’ve noticed that in 5.0 that when I use IN before my parameter I get a syntax error, but here it goes:
DROP PROCEDURE ShowCallsForDay
//
CREATE DEFINER=root
@localhost
PROCEDURE ShowCallsForDay
(p_indate DATE)
BEGIN
select p_indate;
select ‘Internet Calls’, count() from InternetCalls where date(calldate) = p_indate;
select ‘Dailys Calls’, count() from DailysCalls where date(calldate) = p_indate;
select ‘ODEXBK Calls’, count() from ODEXBK_Calls where date(calldate) = p_indate;
select ‘HOUSE Calls’, count() from HOUSE_Calls where date(calldate) = p_indate;
select ‘ODEXGEN Calls’, count() from ODEXGEN_Calls where date(calldate) = p_indate;
select ‘CBDEX Calls’, count() from CBDEX_Calls where date(calldate) = p_indate;
END
Here is the output when I select p_indate inside the Stored Procedure:
mysql> call ShowCallsForDay(‘05/14/2012’);
±-----------+
| p_indate |
±-----------+
| 0000-00-00 |
±-----------+
1 row in set (0.00 sec)
Any help would be much appreciated. Thanks