I would like to make this process in batches, because of the volume.
Here\'s my code:
getconn = conexiones()
con = getconn.mysqlDWconnect()
with con:
Thank you, here's how I implement it with your suggestions:
control = True
index = 0
while control==True:
getconn = conexiones()
con = getconn.mysqlDWconnect()
with con:
cur = con.cursor(mdb.cursors.DictCursor)
query = "SELECT id, date, product_id, sales FROM sales limit 10 OFFSET " + str(10 * (index))
cur.execute(query)
rows = cur.fetchall()
index = index+1
if len(rows)== 0:
control=False
for row in rows:
dataset.append(row)