Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- conn=pg.connect(host="XXX",database="XXX", user="XXX", password="XXX")
- cur = conn.cursor('my_cursor')
- cur.execute("select XX,XXX from XXXX")
- count = 0
- data = []
- while True:
- rows = cur.fetchmany(100)
- if not rows:
- break
- for id, xml in rows:
- count += 1
- if count % 5000 == 0:
- print('processing The %d record' % count)
- data.append(Extract_info(id, xml, 'progressive', Dict_info))
- pass
- cur.close()
Add Comment
Please, Sign In to add comment