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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -