Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 插入到表中并获取错误:sqlite3.ProgrammingError:您没有为绑定1提供值_Python_Python 3.x_Sqlite - Fatal编程技术网

Python 插入到表中并获取错误:sqlite3.ProgrammingError:您没有为绑定1提供值

Python 插入到表中并获取错误:sqlite3.ProgrammingError:您没有为绑定1提供值,python,python-3.x,sqlite,Python,Python 3.x,Sqlite,我已经提供了所有的值。但它仍然给了我一个错误,我并没有为绑定1提供值。这是我的代码: conn = sqlite3.connect('Minerva_app.db') c = conn.cursor() c.execute(""" INSERT INTO tbl_contracts(contractName, category_id, startDate, endDate, price, periods, dateCrea

我已经提供了所有的值。但它仍然给了我一个错误,我并没有为绑定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.

我遗漏了什么?

删除字典键字符串中的冒号。Michael Butscher。非常感谢你!请参阅以获取更好的调试信息