【发布时间】:2017-10-20 04:55:35
【问题描述】:
假设我创建了一个 sqlite3 数据库,并在其中创建了一个表
c.execute("CREATE TABLE tablnam(thing TEXT, thing2 TEXT, thing3 TEXT)")
然后我列了一个清单
list = ["a","b","c"]
我将如何将一个列表插入到 tablnam 中的一行。 我试过了
c.execute("insert into this values(?)",list)
但它会返回
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: parameters are of unsupported type
所以向那些不明白的人澄清一下:我想在 python 的 sqlite3 表的 ONE 行中插入一个列表值 谢谢!
【问题讨论】:
标签: python list python-3.x sqlite