10 Replies Latest reply: Nov 19, 2012 9:53 AM by jeneesh RSS

    PL/SQL --forall clause

    969801
      <div class="jive-quote">

      CREATE OR REPLACE PROCEDURE IND_MONITOR(P_tab VARCHAR2)
      is
      type ind_table is table of varchar2(20);
      p_ind ind_table;
      v_sql varchar2(2000);
      begin
      select index_name bulk collect into P_Ind from user_indexes where table_name=upper(P_tab);
      for i in 1..p_ind.count loop
      v_sql :='alter index '||p_ind(i)|| ' monitoring usage'
      execute immediate v_sql using p_ind(i);
      end loop;

      end;






      can i use forall instead of 'for loop ..end loop'



      </div>