title: oracle stored procedure to import csv file into target table
body: <p>I have a stored procedure to insert CSV data into an oracle table using the UTL functions. The part I am getting stumped on is when I have to use <code>regexp_substr</code> before doing the inserts into the target table. I went over <code>regexp_substr</code> in a variety of websites, but still don't quite grasp the concept as to how I should apply it to this specific import procedure. </p>
  
  <p>For example lets say we have the following lines of code:</p>
  
  <pre><code>             V_EMPNO := REGEXP_SUBSTR(V_LINE, '[^,]+', 1, 1);
               V_ENAME := REGEXP_SUBSTR(V_LINE, '[^,]+', 1, 2);
  </code></pre>
  
  <p>The blunt question I have is, can someone please explain to me how the logic works for this line? I have a CSV file and target table that contains 75 fields, so of course this is just a sampling and I know I have this section written out long. I assumed the last part of the string was just the line number so I kept incrementing it. </p>
  
  <p>Another question I have is, should I go ahead and define all the records as variables and do the <code>regexp_substr</code> individually on all the fields that are part of the import?</p>