title: how to insert whole data frame to oracle table with duplicate records in the data frame
body: <p>Every day I pul data from an external site and use RODBC to upload the data to the oracle table. It seems straight forward but somethimes the data that I am pulling from the external site may be duplicate (meaning there may be some rows in the data that may already exist in the oracle table).</p>
  
  <p>I am currently doing this to load the data:</p>
  
  <pre><code>insert&lt;-function(x){
  tryCatch({
      x&lt;-x[complete.cases(x),]
      x&lt;-unique(x)
      x[, 3:5] &lt;- sapply(x[, 3:5], as.character)
      x[, 3:5] &lt;- sapply(x[, 3:5], as.numeric)
      ch=odbcConnect("&lt;id&gt;",pwd = "&lt;passwd&gt;")
      sqlSave(ch,x, tablename="&lt;tablename&gt;", rownames=FALSE, append=TRUE)
      print("insert of dat is successfull!!!!")
        },error = function(e) {
        print("insert failed!!!!")
        print(odbcGetErrMsg(ch))
      })
    odbcClose(ch) 
  }  
  </code></pre>
  
  <p>I have tested this and it shows that if there is a duplicate entry in my data frame to be inserted into the oracle table, the whole sqlSave fails.</p>
  
  <p>If the whole sqlSave command fails, I can try to insert one line at a time, but this takes forewever to complete. The script never catches up.</p>
  
  <p>I was curious to see is there an option to sqlSave or anything to just ignore the duplicate records and inserts everthing else with sqlSave. Any insight is greatly appreciate.</p>