title: array comparision in oracle to get the difference between two arrays
body: <p>I have 2 arrays with 10 values in each array.
  i want to compare the two arrays for finding the difference between column values and print difference columns with old value and new value and store the results in third array.
  How i can do that in oracle.</p>
  
  <pre><code>DECLARE**strong text**
  TYPE array_t is v_array(20) of table%rowtype;
  array_diff1 array_t := array_t();
  array_diff2 array_t := array_t();
  array_diff3 array_t := array_t();
  
  BEGIN
      select * into array_diff1 from table where id =20;
      select * into array_diff2 from table where id =30;
      for i in  array_diff1 
          loop
          for j in array_diff2
          loop
              if array_diff1(i) != array_diif2(j) then
                  DBMS_OUPUT.PUT_LINE('are not equal');
                  **##get the column with the value in array_diff3.**
              else
                  DBMS_OUPUT.PUT_LINE('are equal');
              END IF;
          END LOOP;
          END LOOP;
  END;
  </code></pre>