mysql - How to make use of variable on a function -
i need make stored function:
this code
select count(dominio) thogar dominio='%'
i need make stored function write letter between (u,c,r) , function replace % in previous code selected letter.
how can it? thanks!
got working
create function `buscar`(`param` char(1)) returns int language sql not deterministic contains sql sql security definer comment '' begin declare res int; select count(dominio) res thogar dominio=param; return res; end call buscar('c')
this should work:
drop function if exists myfunc; delimiter $$ create function myfunc( param char(1) ) returns int; begin declare res int; select count(dominio) res thogar dominio=param; return res; end; $$ delimiter ;
Comments
Post a Comment