A
A
Alikhan2021-08-11 13:24:03
Python
Alikhan, 2021-08-11 13:24:03

Deleting a row from a sqlite3 database table in python does not work. What to do?

I used sqlite3 to work with a python database
and ran into a problem that the delete command does not delete
the specified row in the database table.

cursor.execute(f"DELETE FROM links WHERE ROWID = 1")


Here is the code, for some reason it does not delete the specified row in the database table.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2021-08-11
Mulaev @AlikhanPython

Alikhan Mulaev , if you do not forget to commit, then most likely there is no such rowid in the table or there is, but not for the row that you expect. It's better not to rely on rowid, but to use explicit criteria or a specific primary key.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question