title: Mysql 'LOAD DATA LOCAL INFILE' specify column's value depending on file
body: <p>I am stuck in a situation where I have to read data from 3 separate large CSV files and store it in MySQL database.</p>
  
  <p>csv file columns:</p>
  
  <blockquote>
    <p>total_rev,monthly_rev,day_rev</p>
  </blockquote>
  
  <p>Database table's columns:</p>
  
  <blockquote>
    <p>total_rev, monthly_rev, day_rev, from</p>
  </blockquote>
  
  <p>I am able to insert data in my table by using following query:</p>
  
  <pre><code>LOAD DATA LOCAL INFILE '/home/datauser/Desktop/working/revenue_2016_10_06.csv'  
  INTO TABLE revenue_table  
  FIELDS TERMINATED BY ','   
  LINES TERMINATED BY '\n'  
  (total_rev,monthly_rev,day_rev);
  </code></pre>
  
  <p>But I am stuck in a situation where I want to add hard coded parameter in the "Load Data Local" query to add <strong>from</strong>'s value depending upon the file.</p>
  
  <p>so at the end my table will contain records like:</p>
  
  <pre><code>total_rev, monthly_rev, day_rev,  from
    11,       222,          333,    file1
    22,        32,          343,    file1
    11,        22,          333,    file1
    11,        22,           33,    file22
    11,        22,           33,    file22
  </code></pre>
  
  <p>How can I specify this file1, file22 value's in above query ?</p>