Hl2 Error Code 1305
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us http://stackoverflow.com/questions/38559083/error-code-1305-function-or-procedure-does-not-exist Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Code: 1305. FUNCTION or PROCEDURE does not hl2 error exist up vote 1 down vote favorite So I'm creating a function in MySQL and then trying to grant permission to use that function to a user and am unable to do so. Here's what I'm doing: DELIMITER $$ USE rxhelp36_scbn$$ DROP FUNCTION IF EXISTS `businessDayDiff` $$ CREATE FUNCTION `businessDayDiff` (start DATETIME, stop DATETIME) RETURNS TINYINT NO SQL BEGIN RETURN 5 * (DATEDIFF(stop, start) DIV 7) + MID('0123444401233334012222340111123400001234000123440', hl2 error code 7 * WEEKDAY(start) + WEEKDAY(stop) + 1, 1); END $$ GRANT EXECUTE ON PROCEDURE rxhelp36_scbn.businessDayDiff TO 'myuser'@'localhost'; Here's the error I'm getting: Error Code: 1305. FUNCTION or PROCEDURE businessDayDiff does not exist I don't get it. I /just/ defined the function - how does it not exist? mysql share|improve this question edited Jul 25 at 3:45 asked Jul 25 at 2:58 neubert 6,275113894 Is rxhelp36_scbn your current schema? –Jodevan Jul 25 at 3:08 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote Are you sure you create the procedure under database: rxhelp36_scbn? Maybe you should use below statement under "DELIMITER $$" USE rxhelp36_scbn$$ share|improve this answer answered Jul 25 at 3:08 King 112 add a comment| up vote 0 down vote Try the below function, this could be because of space you left between CREATE FUNCTION, businessDayDiff & ( DELIMITER $$ DROP FUNCTION IF EXISTS `businessDayDiff` $$ CREATE FUNCTION `businessDayDiff`(start DATETIME, stop DATETIME) RETURNS TINYINT NO SQL BEGIN RETURN 5 * (DATEDIFF(stop, start) DIV 7) + MID('0123444401233334012222340111123400001234000123440', 7 * WEEKDAY(start) + WEEKDAY(stop) + 1, 1); END $$ GRANT EXECUTE ON PROCEDURE rxhelp36_scbn.businessDayDiff TO 'myuser'@'localhost'; share|improve this answer answered Jul 25 at 3:13 Shiv