Skip to content Skip to sidebar Skip to footer

Python - Sqlite Interfaceerror: Error Binding Parameter 0 - Probably Unsupported Type

i am using sqlite3 to store values into database, My problem is i have created lineedits through which i extract values and store it to variables and pass this variables to insert

Solution 1:

The method from where you're getting the text "le1.text()", doesn't stores the value in string format. I was getting the same error, sorted out that my data type was mismatched. I converted this value to string and it worked fine.

Also don't miss to add comma in the end because the execute query takes tulip.

self.queryCurs.execute('''INSERT INTO USER(USERNAME, PASSWORD, PERMISSION) 
        VALUES(?,?,?)''',(str(self.uname),str(self.passwd),str(self.permssn),))

Solution 2:

Values should be in touple (square brackets), like this:

self.queryCurs.execute("INSERT INTO USER(USERNAME, PASSWORD, PERMISSION) VALUES(?,?,?)",[self.uname, self.passwd, self.permssn])

Since you add values at the same order as columns in your table are, you don't really need them in your query, so this will also work:

self.queryCurs.execute("INSERT INTO USER VALUES(?,?,?)",[self.uname, self.passwd, self.permssn])

Post a Comment for "Python - Sqlite Interfaceerror: Error Binding Parameter 0 - Probably Unsupported Type"