mysql - Cause to return null values when calling a function -


i trying create function extracts table, employee name begins j

delimiter $$ create function myfunction(nume_persoane varchar (30)) returns int deterministic begin declare omcucap int; select first_name omcucap  employee id = nume_persoane , first_name = 'j%'; return omcucap; end $$ 

when call function select myfunction(first_name) employee; returns null. why that? explication..

omcucap int; 

is first_name int type? don't think so.

and consider following change

upper(first_name) 'j%'; 

you can't use = '%'


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -