title: How to overcome Syntax error using Sqlite3 UPSERT with executemany in a python multidimensional dictionary with keys as placeholders?
body: <p>I have json object that I receive from a server, that is converted to a python multidimensional dictionary within a kivy App.  This dictionary I want to insert into or update on conflict a Sqlite3 datatable using <code>executemany()</code>.  The problem is I am receiving a <code>near "ON": syntax error</code>.  Can someone please give me pointers on how I can resolve this issue? <br><br>
  I have tried removing the the colon from the query <code>VALUES</code> as well as only getting the dictionary.values() with no success.<br><br> 
  Multidimensional dictionary layout:</p>
  
  <pre><code>arr = {0: {'empid': 0, 'empname': 'employee0', 'empnumber': 2000}, 1: {'empid': 1, 'empname': 'employee1', 'empnumber': 2001}, 2: {'empid': 2, 'empname': 'employee2', 'empnumber': 2002}, 3: {'empid': 3, 'empname': 'employee3', 'empnumber': 2003}, 4: {'empid': 4, 'empname': 'employee4', 'empnumber': 2004}, 5: {'empid': 5, 'empname': 'employee5', 'empnumber': 2005}, 6: {'empid': 6, 'empname': 'employee6', 'empnumber': 2006}, 7: {'empid': 7, 'empname': 'employee7', 'empnumber': 2007}, 8: {'empid': 8, 'empname': 'employee8', 'empnumber': 2008}, 9: {'empid': 9, 'empname': 'employee9', 'empnumber': 2009}, 10: {'empid': 10, 'empname': 'employee10', 'empnumber': 2010}}
  </code></pre>
  
  <p>Sqlite datatable:</p>
  
  <pre><code>import os
  import sqlite3 as sl
      def create_emp_table(self, cur):
          cur.execute('CREATE TABLE IF NOT EXISTS emp_tb(\
                      emp_id INTEGER PRIMARY KEY NOT NULL,\
                      emp_names TEXT NOT NULL,\
                      emp_number TEXT NOT NULL UNIQUE)')
  </code></pre>
  
  <p>Sqlite query:</p>
  
  <pre><code>    def insert_emp_name_data_mult(self,conn, cur, arr):
          sql_err = (sl.IntegrityError, sl.OperationalError, sl.ProgrammingError, sl.InterfaceError)
          try:
              query = "INSERT INTO emp_tb(emp_id, emp_names, emp_number)\
                          VALUES(:empid,:empname, :empnumber) ON CONFLICT (emp_id) DO UPDATE SET  emp_names=excluded.emp_names, emp_number.excluded.emp_number"
              cur.executemany(query, arr.values())
              conn.commit()
              return True
          except self.sql_err as err:
              print('error', err)
              cur.close()
              return False
  </code></pre>
  
  <p>I would want to insert or update the table using the multidimensional dictionary key:value pair as efficiently as possible?</p>