create or replace function ft_memgrp( as_coopid char , as_memgrp char ) return varchar is ls_memgrpdesc varchar(150); begin if as_coopid is null or as_memgrp is null then return ''; end if; select nvl( membgroup_desc , '' ) into ls_memgrpdesc from mbucfmembgroup where coop_id = as_coopid and membgroup_code = as_memgrp; return trim(ls_memgrpdesc); end;