Python Forum
I need help creating tables with Sqlite3
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need help creating tables with Sqlite3
#2
Does it fail for the first table, or the second?
Have you tried adding a semicolon to the end of the statement, to let sqlite know it's the end of the statement?  I don't know a lot about sqlite, but it could just be batching all the execute statements together, and actually executing them at the same time when the transaction commits (... which might be when the cursor falls out of scope).

Add a call to print with the sql statement just before calling execute, so we can see if it fails the first time around, or the second.
Reply


Messages In This Thread
I need help creating tables with Sqlite3 - by Rius2 - Sep-24-2017, 12:32 PM
RE: I need help creating tables with Sqlite3 - by nilamo - Sep-25-2017, 05:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Creating a table in SQLite3 djwilson0495 2 2,107 Aug-10-2020, 03:01 PM
Last Post: djwilson0495
  Creating Tables in SQL danteslion 2 44,247 Jun-22-2019, 08:13 PM
Last Post: Gribouillis
  sqlite3 table structure and db tables pythonNoob 7 4,994 May-16-2018, 02:19 PM
Last Post: pythonNoob

Forum Jump:

User Panel Messages

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