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
Post a Comment