title: PL/SQL - prevent ORA-06502
body: <p>I frequently get this error (it is so annoying!):</p>
  
  <blockquote>
    <p>Error report: ORA-06502: PL/SQL: numeric or value error: character
    string buffer too small ORA-06512: at line 305
    06502. 00000 -  "PL/SQL: numeric or value error%s"</p>
  </blockquote>
  
  <p>Example stored procedure is looping through a cursor (that has approx 10k rows), doing some logic and then using <code>dbms_output.put_line</code> to print each record to the <code>'Script Output'</code> tab in Oracle SQL Developer.</p>
  
  <p>Is there a way to flush out the the buffer or prevent this error coming up (and aborting the rest of the proc)?</p>
  
  <p>If that is possible I could use the <code>Mod function</code> to clear the buffer every 10 or so rows processed.</p>