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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -