sqlyog - Error creating function in MySQL -


trying create function in mysql won't go through.

delimiter $$ use `companydb`$$ drop function if exists `sf_utils_get_hm`$$ create function `sf_utils_get_hm`(sec int) returns varchar(20) charset latin1 begin     declare result varchar(20);     if sec >= 3600 set result = time_format(sec_to_time(seconds),'%kh %lm');     else set result = time_format(sec_to_time(seconds),'%lm');     return result; end$$ delimiter ; 

it returns error:

query: create function `sf_utils_get_hm`(sec int) returns varchar(20) charset latin1 begin declare result var...  error code: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 7 

for life of me can't see what's wrong. line 7 points end$$ which...should correct. i'm pretty sure syntax correct. related mysql version? i'm using 5.0.67.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

android - Inheriting from Theme.AppCompat* -