create or replace FuncTion ft_getgrpcontrol( 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( mctrl.membgroup_desc , '' )
	into ls_memgrpdesc
	from mbucfmembgroup mgrp , mbucfmembgroup mctrl
	where mgrp.coop_id = mctrl.coop_id(+)
	and mgrp.membgroup_control = mctrl.membgroup_code(+)
	and mgrp.coop_id = as_coopid
	and mgrp.membgroup_code = as_memgrp;
	return trim(ls_memgrpdesc);
end ;
/
