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

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -