title: mysql load data local infile syntax issues with set fields
body: <p>I'm trying to use mysql's <code>LOAD DATA LOCAL INFILE</code> syntax to load a <code>.csv</code> file into an existing table.  Here is one record from my <code>.csv</code> file (with headers):</p>
  
  <pre><code> PROD,       PLANT,PORD,  REVN,A_CPN,     A_CREV,BRDI,       DTE,     LTME
   100100128144,12T1,2070000,04,3DB18194ACAA,05_01,ALA13320004,20130807,171442
  </code></pre>
  
  <p>The issue is that I want 3 extra things done during import:</p>
  
  <ol>
  <li><p>A <code>RECORDID</code> INT NOT NULL AUTO_INTEGER PRIMARY_KEY field should be incremented as each row gets inserted (this table column and structure already exists within the mysql table)  </p></li>
  <li><p>DTE and LTME should be concatenated and converted to a mysql <code>DATETIME</code> format and inserted into an existing mysql column named <code>TRANS_OCR</code></p></li>
  <li><p>A <code>CREATED</code> TIMESTAMP field should be set to the current unix timestamp on row insertion (this table column and structure already exists as well within the mysql table) </p></li>
  </ol>
  
  <p>I'm trying to import this data into the mysql table with the following command:</p>
  
  <pre><code> LOAD DATA LOCAL INFILE 'myfile.csv' INTO TABLE seriallog
   FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'
   LINES TERMINATED BY '\n'
   IGNORE 1 LINES
   (FLEX_PN, FLEX_PLANT, FLEX_ORDID, FLEX_REV, CUST_PN, CUST_REV, SERIALID)
   SET CREATED = CURRENT_TIMESTAMP;
  </code></pre>
  
  <p>I think I have the <code>CREATED</code> column set properly but the others are causing a mysql warning to be issued:</p>
  
  <pre><code>Warning: Out of range value for column 'FLEX_PN' at row 1
  Warning: Row 1 was truncated; it contained more data than there were input columns
  </code></pre>
  
  <p>Can someone help me with the syntax, the <code>LOAD DATA LOCAL INFILE</code> module is confusing to me...</p>