I am trying to loop through a series of rows in an SQLite DB using the following code:
cur.execute("SELECT * FROM SmallBodyDB")
count = 0
for row in cur:
- Some code -
conn.commit()
count = count + 1
The code in - some code - works fine, but will only look at the first line. Basically, it will only loop once. I need it to loop through the whole DB.
Any ideas why?
Cheers
countvariable?for count, row in enumerate(cur.fetchall()):which gives you the count for pretty much no extra cost