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

0

1 Answer 1

2

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

conn.commit()
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.