Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sqlite3 foreign key
#3
Quote:c.execute('INSERT INTO transformers(name) VALUES(4523)')
Table transformers has no field named name. Use something like this to insert and then you commit to update the database --> SQLite tutorial http://zetcode.com/db/sqlitepythontutorial/


c.execute('INSERT INTO windings values (?,?)', (transformer_id, 4))
con.commit() 
Reply


Messages In This Thread
sqlite3 foreign key - by dsvinson - Mar-31-2018, 01:22 PM
RE: sqlite3 foreign key - by Larz60+ - Mar-31-2018, 01:41 PM
RE: sqlite3 foreign key - by woooee - Mar-31-2018, 04:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  FOREIGN KEY constraint failed SalsaBeanDip 2 2,903 Dec-05-2020, 10:22 PM
Last Post: SalsaBeanDip
  [split] create a virtual keyboard of an unknown foreign language with python fakoly 0 2,475 May-28-2018, 01:34 AM
Last Post: fakoly

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020