我已经提供了所有的值。但它仍然给了我一个错误,我并没有为绑定1提供值。这是我的代码:
conn = sqlite3.connect('Minerva_app.db')
c = conn.cursor()
c.execute("""
INSERT INTO tbl_contracts(contractName, category_id, startDate, endDate, price, periods, dateCreated
, dateUpdated, notes, activeStatus, file_id)
VALUES(:contractName1, :category1, :startDate1, :endDate1, :price1, :periods1, :dateCreated1
, :dateUpdated1, :notes1, :activeStatus1, :file_id1)
""",
{
':contractName1': self.contactNameEntry.get(),
':category1': cat_id,
':startDate1': self.startDateEntry.get(),
':endDate1': self.endDateEntry.get(),
':price1': self.priceEntry.get(),
':periods1': self.periodsEntry.get(),
':dateCreated1': now,
':dateUpdated1': now,
':notes1': self.notesText.get("1.0", tk.END),
':activeStatus1': self.active.get(),
':file_id1': file_id1
}
)
conn.commit()
conn.close()
这就是错误:
':file_id1': file_id1
sqlite3.ProgrammingError: You did not supply a value for binding 1.
我错过了什么
目前没有回答
相关问题 更多 >
编程相关推荐