drop function if exists iffunction // create function iffunction(p_inparam VARCHAR(10)) returns VARCHAR(10) begin declare l_value VARCHAR(10); if p_inparam = 'A' then set l_value := 'This was A'; else set l_value := 'Not A'; end if; return l_value; end //