title: Oracle SQLLDR Discard rows using WHEN clause not working
body: <p>I am trying to load a text file, only those rows where 3rd column 'c_nbr' Doesn't END with 'ABCD'. Since WHEN clause is really primitive I could not use, trim/substring with it.</p>
  
  <p>My second choice was to put the last 4 chars of c_nbr field to a column called 'MSGCOL' and use that column in my WHEN clause, like " WHEN MSGCOL  &lt;> 'ABCD' ".</p>
  
  <p>The MSGCOL is getting value "ABCD" where column 'c_nbr' ends with "ABCD", but the WHEN clause is not DISCARDing them. </p>
  
  <p>Why it's not working? How can I achieve my goal? Can I run SQL Query from sqlldr control file itself? Like "Delete from tbl_load where c_nbr like '%ABCD';" at the end of loading commands?</p>
  
  <p>SQLLDR Control File:-</p>
  
  <pre><code>OPTIONS (ERRORS=9999)
  LOAD DATA
  
  INFILE '052140.csv'
  BADFILE '052140.BAD'
  DISCARDFILE '052140.DIS'
  
  INFILE '055913.csv'
  BADFILE '055913.BAD'
  DISCARDFILE '055913.DIS'
  
  APPEND INTO TABLE tbl_load
  WHEN MSGCOL  &lt;&gt; 'ABCD'
  FIELDS TERMINATED BY ',' optionally enclosed by '"' trailing nullcols 
  (
  id "TRIM(UPPER(:ID))",
  pid,
  c_nbr "TRIM(:c_nbr)",
  a_nbr "SUBSTR(TRIM(:a_nbr), 1, 25)",
  P_REASON2 FILLER,
  MSGCOL EXPRESSION "substr(trim(:c_nbr), length(trim(:c_nbr))-3, 4)"
  )
  </code></pre>