SQLite Forum

(Deleted)
Login
I have no problem with the creation of tables and fields. Because tables and fields are created. IN = GIRIS_SAATI (actual field name in DB table) 

The area I'm having trouble with is the insert side below. Because there are 9 fields to enter data on the GUI and there are 10 columns on the database table.

cur.execute("INSERT INTO Visitors (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (VisitorsName, VisitorsPhone, VisitorsCompany, VisitorsPersonDepartment, VisitorsExplanation, VisitorsCardNo, VisitorsDate, VisitorsIn, VisitorsOut)) 

When I play on this area, I get various mistakes:

1-) (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 

The error I get when I do is: sqlite3.OperationalError: 10 values for 9 columns

2-) (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI, ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 

The error I get when I do is: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 10, and there are 9 supplied.

3-) (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (VisitorsName, VisitorsPhone, VisitorsCompany, VisitorsPersonDepartment, VisitorsExplanation, VisitorsCardNo, VisitorsDate, VisitorsIn, VisitorsOut, ID)

ID = "" , ? , NOT NULL, etc... when i assign a variable

The error I get when I do is: sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.

4-) and when i close this field it opens GUI without problem

/* #cur.execute("INSERT INTO Visitors (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (VisitorsName, VisitorsPhone, VisitorsCompany, VisitorsPersonDepartment, VisitorsExplanation, VisitorsCardNo, VisitorsDate, VisitorsIn, VisitorsOut)) */ 

I think it is due to the fact that I cannot process the ID field.But I'm not sure