Python Forum
sqlite3 table structure and db tables
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sqlite3 table structure and db tables
#6
Quote:I thought conn = would open the database sqlite file if it exist or create the file if it doesn't?
I was referring to a table, not a file, my mistake. To create a table if it doesn't exist, use
cur.execute("CREATE TABLE IF NOT EXISTS " etc. 

Quote:slight error on database open:
open database with:
con = sqlite3.connect(table_name)
I import sqliteX as sqlite. Then, if there is a version change I only have to update the import statement.
Reply


Messages In This Thread
RE: sqlite3 table structure and db tables - by woooee - May-16-2018, 12:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Using SQLAlchemy, prevent SQLite3 table update by multiple program instances Calab 3 821 Aug-09-2023, 05:51 PM
Last Post: Calab
  Slittping table into Multiple tables by rows drunkenneo 1 2,122 Oct-06-2021, 03:17 PM
Last Post: snippsat
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 7,955 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  Python script to summarize excel tables, then output a composite table? i'm a total n surfer349 1 2,429 Feb-05-2021, 04:37 PM
Last Post: nilamo
  Load data from One oracle Table to Multiple tables amy83 1 1,824 Dec-02-2020, 01:57 AM
Last Post: Larz60+
  Adding data to a table in SQLite3 djwilson0495 2 3,116 Aug-15-2020, 02:48 PM
Last Post: djwilson0495
  Creating a table in SQLite3 djwilson0495 2 2,121 Aug-10-2020, 03:01 PM
Last Post: djwilson0495
  How read Table Structure from Database nnsatpute 5 3,833 Oct-25-2019, 10:08 AM
Last Post: Larz60+
  Database table structure compare(Oracle) GKT 4 2,866 Oct-16-2019, 03:16 PM
Last Post: GKT
  sqlite3 db and table design pythonNoob 4 3,918 May-22-2018, 11:21 PM
Last Post: woooee

Forum Jump:

User Panel Messages

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