SQLite: LIKE clause won't work with DELETE

Question:

I was trying to delete rows in a table using the like clause, the query doesn’t produce an error but the query doesn’t delete the rows.

cur.execute("DELETE FROM urls WHERE url LIKE 'https%';")

Meanwhile the query to select the same works.

cur.execute("SELECT url FROM urls WHERE url LIKE 'https%';")
Asked By: Matblanket

||

Answers:

You need to commit DML queries with con.commit().

PS: You need to label Python code with Python tag.

Answered By: PChemGuy
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.