Oct-27-2017, 08:54 PM
I am trying to insert values into a SQLite DB integrated with Python. I have done that successsfully for most of the tables with an exception of one which has a column name: TOB-2/-2a_Measure_Desc
This snippet shows the fragment where I am making the insertions
This snippet shows the fragment where I am making the insertions
index = "%s__%s" % (tablename, col) sql_query = "CREATE INDEX %s on %s (%s)" % (index, tablename, col) cursor.execute(sql_query) print(tablename) #print(error) insert_values = "INSERT INTO %s VALUES (%s)" % (tablename, ", ".join([ "?" for col in row ]))
Error:Traceback (most recent call last):
File "C:\Users\Rachit-PC\AppData\Local\Continuum\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-50-024cf4abddf6>", line 60, in <module>
cursor.execute(sql_query)
sqlite3.OperationalError: no such column: tob_2__2a_measure_desc