title: How to update a part of oracle database table using pandas df and cx_Oracle cursor()?
body: <p>Suppose my Oracle db table <code>myTable</code> has 10 columns and 10 rows of data with data types like below:</p>
  
  <pre><code>   Column         Data_Type
  1  Calendarday      Date         *Primary key
  2  col1              ...
  .                     .
  .                     .
  .                     .
  10 Flag             Number(1,0)
  </code></pre>
  
  <p>and suppose my pandas dataframe <code>df</code> has 2 columns and 3 rows of data:</p>
  
  <pre><code>Date          Bit
  2000-12-21     1
  2000-12-22     1
  2000-12-23     1
  </code></pre>
  
  <p>Dtypes are: datetime64[ns] and int64.</p>
  
  <p>Basically i want to update the <code>Flag</code> column of <code>myTable</code> with values from <code>Bit</code> in <code>df</code> where <code>Calendarday</code> is equal to <code>Date</code>. So here, i just want to overwrite 3 <code>Flag</code> records and not the entire column or the entire table. The code i am trying is:</p>
  
  <pre><code>cur = con.cursor()
  query = '''insert into myTable (Calendarday, Flag) values (%s, %s);'''
  cur.executemany(query, df[['Date', 'Bit']].values.tolist())
  con.commit()
  </code></pre>
  
  <p>But executing this is giving me error:</p>
  
  <pre><code>cur.executemany(query, df[['Date', 'Bit']].values.tolist())
  cx_Oracle.DatabaseError: ORA-01036: illegal variable name/number
  </code></pre>
  
  <p>I really don't know how to fix it. Do I need to specify the position of columns in <code>myTable</code> or could it be because of date format conversion issue between pandas and Oracle? Please skip suggesting sqlalchemy solutions. Need to do this the cursor way only. Any help would be sincerely appreciated.</p>