CREATE or REPLACE function Descricao_Formula(
   p_cdformula in formula.cdformula%type
) return formula.dsformula%type is
cursor c1 is
  select
     dsformula
  from 
     formula
  where
     cdformula = p_cdformula;
v_dsformula formula.dsformula%type;
begin
   open c1;
   fetch c1 into v_dsformula;
   if c1%found then
      close c1;
      return (v_dsformula);
   end if;
   close c1;
   return (null);
end;
/
