title: How can I tell which record causes the error while doing a cursor fetch?
body: <p>Is there any way to tell which record is causing the error while doing a cursor fetch? For example, let's say I have a table with one column (varchar2), "value", with the following values: </p>
  
  <p>1,
  2,
  3,
  4,
  g,
  5,
  6</p>
  
  <p>I do the following:</p>
  
  <pre><code>DECLARE
      answer number;
      CURSOR c1 IS
      SELECT to_number(value) FROM table;
  BEGIN
     OPEN c1;  
     LOOP
        FETCH c1 INTO answer;
        EXIT WHEN c1%NOTFOUND;
        DBMS_OUTPUT.PUT_LINE(answer);
     END LOOP;
     CLOSE c1;
   EXCEPTION WHEN invalid_number THEN    
      dbms_output.put_line('an invalid number exception was encountered');
  END;
  </code></pre>
  
  <p>Would it ouput without issue until 'g' was encountered? This is a trivial example of a real issue I'm trying to debug. In the real example, it outputs the exception message and nothing else. Does this mean it's the first record that causes the issue, or it just doesn't work this way?</p>