I use pypyodbc to read data from an ms sql server.
I am not sure if the cursor should be closed after any query or just once at the end and I could not find anything in the doc.
Example:
curs = con.cursor()
for id in id_list:
curs.execute ('Select * from XXX where id = {}'.format (id))
curs.fetchall ()
# Write the data into the target...
# curs.close() ???
curs.close()
Is this correct?
thanks