SQLite Forum

Timeline
Login

22 forum posts by user JokerSob

2021-07-27
20:37 Edit: (Deleted) (artifact: 85ee724170 user: JokerSob)
Deleted
20:37 Delete reply: (Deleted) (artifact: e023f23b35 user: JokerSob)
Deleted
20:37 Delete reply: (Deleted) (artifact: e702dd3dd5 user: JokerSob)
Deleted
20:37 Delete reply: (Deleted) (artifact: 9468636e19 user: JokerSob)
Deleted
20:37 Delete reply: (Deleted) (artifact: 222c2a54a7 user: JokerSob)
Deleted
20:36 Delete reply: (Deleted) (artifact: 0b56afde77 user: JokerSob)
Deleted
20:36 Delete reply: (Deleted) (artifact: 9085d0c60d user: JokerSob)
Deleted
20:36 Delete reply: (Deleted) (artifact: b0e7dc9c42 user: JokerSob)
Deleted
20:36 Delete reply: (Deleted) (artifact: 370b58a079 user: JokerSob)
Deleted
20:36 Edit: (Deleted) (artifact: c632fe06b3 user: JokerSob)
Deleted
2021-07-17
23:27 Edit reply: (Deleted) (artifact: 79b9789751 user: JokerSob)

I managed to get a different error now and I'm starting to investigate this right now. By the way, I really appreciate your interest, thank you very much.

new error i get:

VisitorsExplanation = self.ui.text_VisitorsExplanation.text()

AttributeError: 'PySide2.QtWidgets.QTextEdit' object has no attribute 'text'

I hope that after solving this problem, the errors I get are now gone

23:26 Reply: (Deleted) (artifact: 57e95947da user: JokerSob)

I managed to get a different error now and I'm starting to investigate this right now. By the way, I really appreciate your interest, thank you very much.

new error i get:

VisitorsExplanation = self.ui.text_VisitorsExplanation.text() AttributeError: 'PySide2.QtWidgets.QTextEdit' object has no attribute 'text'

I hope that after solving this problem, the errors I get are now gone

23:16 Edit reply: (Deleted) (artifact: eb77429c7c user: JokerSob)

cur.execute ("CREATE TABLE IF NOT EXISTS Visitors (AD_SOYAD TEXT NOT NULL, TELEFON TEXT NOT NULL, FIRMA_ADI TEXT NOT NULL, KISI_BOLUM TEXT NOT NULL, ACIKLAMA TEXT NOT NULL, KART_NO NUMERIC NOT NULL, TARIH TEXT NOT NULL, GIRIS_SAATI TEXT NOT NULL, CIKIS_SAATI TEXT NOT NULL, ID INTEGER NOT NULL UNIQUE PRIMARY KEY AUTOINCREMENT)")

dbss: [url=https://ibb.co/Smny6mb][img]https://i.ibb.co/B6Z3f6b/DB.png[/img][/url]

GUI ss: [url=https://ibb.co/w77xGLK][img]https://i.ibb.co/f99P6SC/QT.png[/img][/url]

The number of GUI code characters is too many, but I am creating an example by reducing it. On other forums I will share the codes after miniaturization.

When I close the field below, the '#' GUI opens. The problem is all about this area.

/#cur.execute("INSERT INTO Visitors (AD_SOYAD, TELEFON, FIRMA_ADI, KISI_BOLUM, ACIKLAMA, KART_NO, TARIH, GIRIS_SAATI, CIKIS_SAATI, ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)", (VisitorsName, VisitorsPhone, VisitorsCompany, VisitorsPersonDepartment, VisitorsExplanation, VisitorsCardNo, VisitorsDate, VisitorsIn, VisitorsOut))/

23:16 Reply: (Deleted) (artifact: 6a20af11fe user: JokerSob)

cur.execute ("CREATE TABLE IF NOT EXISTS Visitors (AD_SOYAD TEXT NOT NULL, TELEFON TEXT NOT NULL, FIRMA_ADI TEXT NOT NULL, KISI_BOLUM TEXT NOT NULL, ACIKLAMA TEXT NOT NULL, KART_NO NUMERIC NOT NULL, TARIH TEXT NOT NULL, GIRIS_SAATI TEXT NOT NULL, CIKIS_SAATI TEXT NOT NULL, ID INTEGER NOT NULL UNIQUE PRIMARY KEY AUTOINCREMENT)")

dbss: [url=https://ibb.co/Smny6mb][img]https://i.ibb.co/B6Z3f6b/DB.png[/img][/url]

GUI ss: [url=https://ibb.co/w77xGLK][img]https://i.ibb.co/f99P6SC/QT.png[/img][/url]

The number of GUI code characters is too many, but I am creating an example by reducing it. On other forums I will share the codes after miniaturization.

When I close the field below, the '#' GUI opens. The problem is all about this area.

#cur.execute("INSERT INTO Visitors (AD_SOYAD, TELEFON, FIRMA_ADI, KISI_BOLUM, ACIKLAMA, KART_NO, TARIH, GIRIS_SAATI, CIKIS_SAATI, ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)", (VisitorsName, VisitorsPhone, VisitorsCompany, VisitorsPersonDepartment, VisitorsExplanation, VisitorsCardNo, VisitorsDate, VisitorsIn, VisitorsOut))

22:43 Reply: (Deleted) (artifact: 815636560b user: JokerSob)

I have followed this path before and the error I get is:

sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.

22:20 Reply: (Deleted) (artifact: 381815bc7c user: JokerSob)

Well, did you read what I wrote at the beginning of the topic?

#There is a GUI built with Pyqt5 Qt and there is no id field on this GUI.I am trying to create SQLite3 database for this GUI.9 columns on GUI and There are 10 columns on the database. so i have problem in insert field. I've been getting errors for days.Since I am a student, I am just learning and I am having difficulties in this regard.

that is, the ID will be generated by the database. No data entry will be made for this field on the GUI. That's why Database 10 column - GUI 9 column. I think I need to make the registration of the ID data in this field with a command such as WHERE or SELECT on the database.

19:06 Reply: (Deleted) (artifact: c074b35ef8 user: JokerSob)

I read the error messages carefully and try to find various solutions, so I try various ways, but I have little knowledge and I am trying to get an idea of what I can do from here.

The mistake is here and now I am sure of it. But I don't know what to do and I've been looking for a solution for days to solve this

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))

How can I make this field work properly?

17:30 Edit reply: (Deleted) (artifact: ebec99ed04 user: JokerSob)

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

17:29 Edit reply: (Deleted) (artifact: 4413f04612 user: JokerSob)

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-) But I'm not sure

/* #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

17:23 Reply: (Deleted) (artifact: 6816a4bd0e user: JokerSob)

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.

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

13:54 Edit: (Deleted) (artifact: 582b2f2bfc user: JokerSob)

There is a GUI built with Pyqt5 Qt and there is no id field on this GUI.I am trying to create SQLite3 database for this GUI.9 columns on GUI and There are 10 columns on the database. so i have problem in insert field. I've been getting errors for days.Since I am a student, I am just learning and I am having difficulties in this regard.Database codes are as follows:

global cur

global con

con = sqlite3.connect('DataBase.db')

cur = con.cursor()

cur.execute ("CREATE TABLE IF NOT EXISTS Visitors (NAME TEXT NOT NULL, PHONE TEXT NOT NULL, COMPANY TEXT NOT NULL, PERSON TEXT NOT NULL, EXPLANATION TEXT NOT NULL, CARD_NO TEXT NOT NULL, DATE STRING NOT NULL, IN TEXT NOT NULL, OUT TEXT NOT NULL, ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT)")

con.commit()

con.close()

def InsertVisitors():

  con = sqlite3.connect('DataBase.db')

  cur = con.cursor()

  VisitorsName = self.ui.line_VisitorsName.text()

  VisitorsPhone = self.ui.line_VisitorsPhone.text()

  VisitorsCompany = self.ui.line_VisitorsCompany.text()

  VisitorsPersonDepartment = self.ui.line_VisitorsPersonDepartment.text()

  VisitorsExplanation = self.ui.text_VisitorsExplanation.text()

  VisitorsCardNo = self.ui.line_VisitorsCardNo.text()

  VisitorsDate = self.ui.label_VisitorsDate.text()

  if self.ui.check_VisitorsIn.isChacked():

        VisitorsIn = self.ui.line_VisitorsIn.text()

  else:

        VisitorsIn = self.ui.label_VisitorsTime.text()

  if self.ui.check_VisitorsOut.isChacked():

        VisitorsOut = self.ui.line_VisitorsOut.text()

  else:

        VisitorsOut = self.ui.label_VisitorsTime.text()

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

  con.commit()

  con.close()

  self.ui.Btn_In.clicked.connect(lambda: UIFunctions.InsertVisitors)

I've been dealing with this problem for days, and I can't find a solution. Can you please give me an idea? Thank you so much in advance for your answers.

13:08 Post: (Deleted) (artifact: 6f95d98868 user: JokerSob)

There is a GUI built with Pyqt5 Qt and there is no id field on this GUI.I am trying to create SQLite3 database for this GUI.9 columns on GUI and There are 10 columns on the database. so i have problem in insert field. I've been getting errors for days.Since I am a student, I am just learning and I am having difficulties in this regard.Database codes are as follows:

global cur

global con

con = sqlite3.connect('DataBase.db')

cur = con.cursor()

cur.execute ("CREATE TABLE IF NOT EXISTS Visitors (NAME TEXT NOT NULL, PHONE TEXT NOT NULL, COMPANY TEXT NOT NULL, PERSON TEXT NOT NULL, EXPLANATION TEXT NOT NULL, CARD_NO TEXT NOT NULL, DATE STRING NOT NULL, IN TEXT NOT NULL, OUT TEXT NOT NULL, ID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT)")

con.commit()

con.close()

def InsertVisitors():

con = sqlite3.connect('DataBase.db')

cur = con.cursor()

VisitorsName = self.ui.line_VisitorsName.text()

VisitorsPhone = self.ui.line_VisitorsPhone.text()

VisitorsCompany = self.ui.line_VisitorsCompany.text()

VisitorsPersonDepartment = self.ui.line_VisitorsPersonDepartment.text()

VisitorsExplanation = self.ui.text_VisitorsExplanation.text()

VisitorsCardNo = self.ui.line_VisitorsCardNo.text()

VisitorsDate = self.ui.label_VisitorsDate.text()

if self.ui.check_VisitorsIn.isChacked():

  VisitorsIn = self.ui.line_VisitorsIn.text()

else:

  VisitorsIn = self.ui.label_VisitorsTime.text()

if self.ui.check_VisitorsOut.isChacked():

  VisitorsOut = self.ui.line_VisitorsOut.text()

else:

  VisitorsOut = self.ui.label_VisitorsTime.text()

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

con.commit()

con.close()

I've been dealing with this problem for days, and I can't find a solution. Can you please give me an idea? Thank you so much in advance for your answers.