title: How to store previous value and current value in for loop
body: <p>I have a cursor C1 which selects column status from table test.</p>
  
  <p>Using <code>for</code> loop, I have to check the previous value for status is <code>ERROR</code> and current value for status is <code>VALID</code>.If so then I have to update table <code>test1</code>. </p>
  
  <p>E.G. </p>
  
  <pre><code>for 1 in 1..c1 loop
  
   if previous.status = ERROR and current.status then
  
    update test1.
  
    end if;
  
  end loop;
  </code></pre>
  
  <p>Please help me how can I store previous and current value from for loop for comparison.</p>