title: How to loop over tokens from a string in Oracle?
body: <p>Say I have a string - <code>'9999,34244324324\n88888,131321323\n77777,8787223'</code>,</p>
  <p>I want each comma separated number from each pair separated by <code>\n</code> to be inserted into two columns in a table.</p>
  <p>For example, like below:</p>
  <pre><code>9999 |34244324324
  88888|131321323
  77777|8787223
  </code></pre>
  <p>With REGEXP_SUBSTR, I am able to get the pairs together:</p>
  <pre><code>REGEXP_SUBSTR(str, '((\d+),(\d+)\n?)',1,i, null, j)
  </code></pre>
  <p>where <code>i</code> find the <code>num,num</code> match and <code>j</code> is 1 or 2 for first or second number.</p>
  <p>I can imagine looping this <code>i</code> times which I can get from <code>REGXP_COUNT</code> but that seems like repeating same thing <code>n</code> times. What is the proper way to achieve this?</p>
  <p>I am doing DB script after a long time so don't remember exactly though I have done this earlier. So I need suggestions on this.</p>