SQL> declare
  2       cursor c1 is
  3       select * from batch;
  4       z c1 %rowtype;
  5    begin
  6       open c1;
  7       fetch c1 into z;
  8       while (c1 %notfound) loop
  9               dbms_output.put_line('Batch Code is : '||z.batchcode);
 10               fetch c1 into z;
 11       end loop;
 12       close c1;
 13  end;
 14  /

PL/SQL procedure successfully completed.
Advertisements