我正在報廢一些websties並希望將這些數據插入到sqlite3數據庫。我成功創建了連接表和數據庫使用python在sqlite3中不支持的類型錯誤
conn.execute('''
CREATE TABLE datatable (id INTEGER PRIMARY KEY, Date TEXT,
Time TEXT, html_link BLOB, Desc BLOB, Tup BLOB)
''')
id is the auto_incriment value
date="03-09-2016"
time="12:34:56"
html="http://web1.com"
des="Oct 21, 2010 - In the code below row is a tuple of 200 elements (numbers) and listOfVars is a tuple of 200 strings that are variable names in the testTable ."
arr=(1,2,3)
然後我試圖插入值,以該表
conn.execute('''INSERT INTO datatable (Date, Time, html_link, Desc, Tup)
VALUES(?,?,?,?,?)''', (date,time,html,des,arr))
但其引發此錯誤
VALUES(?,?,?,?,?)''', (date,time,html,des,arr)) sqlite3.InterfaceError: Error binding parameter 4 - probably unsupported type.
我知道我犯了一些錯誤將適當的數據類型分配給sqlite表。如何找到導致錯誤的列以及如何解決此問題。
那個參數的類型是什麼? –