title: IF ELSE Condition inside FORALL Oracle
body: <p>Can you guys share with how to do <strong>IF ELSE</strong> Inside a <strong>FORALL</strong>?</p>
  
  <p>This is my current code that working fine.</p>
  
  <p>FOR DECLARATION;</p>
  
  <pre><code>TYPE t_column1 IS TABLE OF USERS.column1%TYPE;
  TYPE t_column2 IS TABLE OF USERS.column1%TYPE;
  
  arr_column1     t_column1;
  arr_column2     t_column2;
  
  TYPE t_columnA IS TABLE OF ADDRESS.columnA%TYPE;
  TYPE t_columnB IS TABLE OF ADDRESS.columnA%TYPE;
  
  arr_columnA t_columnA := t_columnA();
  arr_columnB t_columnB := t_columnB();
  
  CURSOR cur IS
      SELECT column1,column2
      FROM USERS;
  
  i       INTEGER;
  l_done  BOOLEAN;
  indx    INTEGER;
  </code></pre>
  
  <p>MAIN CODE:</p>
  
  <pre><code>OPEN cur;
  LOOP
      FETCH cur BULK COLLECT INTO
      arr_column1, arr_column2
      LIMIT 10000;
  
      l_done := curRESALEMASTER%NOTFOUND;
  
      FOR indx IN 1 .. arr_column1.COUNT
      LOOP
          arr_columnA.extend;
          arr_columnB.extend;
  
          arr_columnA(indx) := arr_column1(indx);
          arr_columnB(indx) := 'XYZ';
  
      END LOOP;
  
      FORALL i IN 1 .. arr_column1.COUNT
          INSERT INTO ADDRESS partition VALUES (
              arr_columnA(i),
              arr_columnB(i),
              arr_column2(i);
  
      EXIT WHEN (l_done);
  
  END LOOP;
  COMMIT;
  CLOSE cur;
  </code></pre>
  
  <p>So my issue is how to put condition for <strong>FORALL</strong>?</p>
  
  <p>It will be something like:</p>
  
  <pre><code>    FORALL i IN 1 .. arr_column1.COUNT
      IF arr_columnA(indx) &lt;&gt; NULL THEN
          INSERT INTO ADDRESS partition VALUES (
              arr_columnA(i),
              arr_columnB(i),
              arr_column2(i);
      END IF;
  </code></pre>
  
  <p>But I cannot put condition inside FORALL</p>