基本是这样的结构: declare
   v_col1 varchar2(20);
    ...
   cursor cur is select col1 from table1 where ... ;
   --如果需要动态cursor,需要定义ref cursor begin
   open cur;
   fetch cur into v_col1;
   
   while cur%found 
   loop
      ...
      fetch cur into v_col1;   end loop; 
   close cur;   exception
      when no_data_found then
         ...
 end;