K
K
KPEBETKA2014-02-08 16:35:17
Python
KPEBETKA, 2014-02-08 16:35:17

Python + SQLite. Delete all found lines?

I have a database with an indefinite number of rows and 9 columns.
I get the lines I need like this:

dbcursor.execute('select * from portscan where ip=?', (hostip,))
rows = dbcursor.fetchall()

But how to delete all found lines?
The code -
dbcursor.execute("delete from portscan where ip='%s'" % hostip)
- it seems to work as it should, but the size of the database does not decrease.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
throughtheether, 2014-02-08
@KPEBETKA

> the size of the database does not decrease...
habrahabr.ru/post/172085

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question