问题描述
因此,我正在使用 impala.dbapi ,并且我需要在蜂巢数据库中插入大量数据。有人告诉我可以使用 executemany()插入多个记录,所以我会这样写:
insert_sql = "INSERT INTO db.tablename VALUES (%s,%s)"
values = [(1,1),(2,2),(3,3)]
cursor.executemany(insert_sql,values,{'paramstyle': 'format'})
465 self.execute(operation,parameters,configuration)
466 if self.has_result_set:
--> 467 raise ProgrammingError("Operations that have result sets are "
468 "not allowed with executemany.")
所以我检查了返回值,结果发现实际上有结果集:
In [5]: cursor.fetchall()
Out[5]: [('1 rows affected.',)]
如何使用 executemany()?请帮助...
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)