venerdì 31 gennaio 2014

Oracle PLSQL Dynamic Loop





Dynamic Loop

 
 
 
 Declare  
   v_sql      VARCHAR2(32000);  
   TYPE t_refcrs IS REF CURSOR;  
   c_exttable t_refcrs;  
   v_my_field varchar2(320000 char);  
  BEGIN  
      v_sql := 'select my_field from my_table';  
      v_count := 0;  
      OPEN c_exttable FOR v_sql;  
       LOOP  
        FETCH c_exttable INTO v_v_my_field;  
        EXIT WHEN C_EXTTABLE%NOTFOUND;  
           --My operation  
       END LOOP;  
 End;  

Nessun commento:

Posta un commento