【发布时间】:2018-11-21 10:58:52
【问题描述】:
在 Python 中制作了一个示例脚本以从 Mysql 中删除记录,并尝试将大约 15k 条数据记录插入到 Mysql 数据库中:
我正在使用的查询是:
c2.execute("INSERT INTO dedable_city %s VALUES %s" % (values, lst))
列名中的“values”和“lst”是记录。
这是控制台上的错误:
File "dedupe_main3.py", line 208, in <module>
c2.execute("INSERT INTO deduped_new_table_city %s VALUES %s" % (values, lst))
/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
/connections.py",第 36 行,在默认错误处理程序中 引发错误类,错误值 _mysql_exceptions.OperationalError: (1054, "'field list' 中的未知列 'None'")
这是我打印时的查询:
INSERT INTO deduped_new_table_city (col,col,col,col,col,col,col,col,col,col,col)
VALUES (val, 'val', 'val', 'val', 'val', val , val , 'val', 'val', val, 'val')
我在这里缺少什么?尝试在线搜索但无济于事。
编辑 1:“值”包含
(cluster_id,uniqueid,id,name,hcode,suame,adress,hphone,zipcode,latitude,longitude,rating,city,country)
【问题讨论】: