create or replace FuncTion ft_getdeptname( as_coopid char , as_department char ) return varchar2 is ls_departdesc varchar2(150); begin if as_coopid is null or as_department is null then return ''; end if; select nvl( department_desc , '' ) into ls_departdesc from mbucfdepartment where coop_id = as_coopid and department_code = as_department ; return trim(ls_departdesc); end ; /