Pythonのwin32comモジュールを使用してExcelシートをsqlite3データベースに変換しようとしています。私のExcelシートには6つの列があるので、Pythonコードの一部は次のとおりです。
for row in exceldata:
c.execute('INSERT INTO exceltable1 VALUES(?,?,?,?,?,?)',row)
conn.commit()
しかし、Pythonは私に次のエラーを出します:
c.execute('INSERT INTO exceltable VALUES(?,?,?,?,?,?)',row)
ProgrammingError: Incorrect number of bindings supplied. The current statement uses 6, and there are 5 supplied.
1つの疑問符を削除して再度実行しようとすると、エラーは次のようになります。
c.execute('INSERT INTO exceltable1 VALUES(?,?,?,?,?)',row)
OperationalError: table exceltable1 has 6 columns but 5 values were supplied
誰かがここで何が起こっているのか、そして解決策があれば私に説明してもらえますか...
Thx。