declare

   cost float :=0;
   myFlav  varchar2(20);  

   cursor pastry is 
                 select price as Money from goods where flavor = 'Chocolate';

   
   myPastry pastry%rowtype;

begin
  dbms_output.enable;

  open pastry;
 
  loop
    fetch pastry into myPastry;
    exit when pastry%notfound;
    cost := cost + myPastry.Money;
  end loop;    
  
  close pastry;

  dbms_output.put_line('Cost of all Chocolate items is '|| cost);
  
  
end;
/
