title: UPSERT in Oracle using Python Pandas
body: <p>I am wanting to use <code>cx_Oracle</code> and <code>pandas</code> to read a csv containing verified dataset and either insert or update each record in the csv into an Oracle table based on a primary key. If a primary key column value is null in the csv, every column in that row will be inserted as a new row in oracle, but if a primary key column value is not null (already exists in the oracle table), then i want to update values from the csv for only the columns where the value is not null (empty).</p>
  <p>For example, if my csv looks like this (ID as primary key):</p>
  <pre><code>ID,FIRSTNAME,LASTNAME,AGE,SALARY
  null,John,Smith,30,40000
  2,James,Johnson,15,null
  </code></pre>
  <p>I would need to insert every column in the first row so that my oracle table would generate a new ID for it, but i would need to update only FIRSTNAME, LASTNAME,AGE for rows with ID=2 in the oracle table.</p>
  <p>How would I go about 1. generating the new ID for new rows (incrementing from the highest existing ID in the table) and 2. selecting which columns to update based on which columns are not null in the csv?</p>
  <p>Note that the data will be imported into a dataframe before being updated/inserted into the database.</p>