-1

I'm new to python and SQLite, so I apologize if this is a dumb question. I've written the code below to open up a database and delete the data in the STAGING_LIDs table. The script runs, but when I check the DB, the data is still there. Am I doing something wrong?

import sqlite3
import csv

conn = sqlite3.connect('C:\\SQLite\\Budget_Dev.db')
cur = conn.cursor()

#delete all table data
cur.execute("DELETE FROM STAGING_LIDs;")

I'm using bernie's answer in this question (the accepted answer) as a template.

Community
  • 1
  • 1
jones-chris
  • 629
  • 2
  • 13
  • 29

1 Answers1

2

I figured it out. I needed to add a line:

conn.commit()
CL.
  • 173,858
  • 17
  • 217
  • 259
jones-chris
  • 629
  • 2
  • 13
  • 29