日期:2014-05-16  浏览次数:20432 次

oracle 非for循环的动态循环语句.
针对动态语句有时候需要动态判断语句

set serveroutput on size 800000;

declare 
  i_l_id number := 0;
  cur_pocon_prov_id sys_refcursor;
begin

    open cur_pocon_prov_id for 'select aaa from t_aaa ';
    loop 
                fetch cur_pocon_prov_id into i_l_id; 
                exit when cur_pocon_prov_id%notfound; 
               Dbms_Output.put_line(i_l_id); 
                
                
    end loop; 
    close cur_pocon_prov_id;
end;
/