sql_statement = ' '.join(['select d.* ', 'from dr_snapshot d ',
    'order by d.PremiseID asc, d.last_read asc; '])
sel_cur = db.cursor()
rc = sel_cur.execute(sql_statement)
loop_ok = True
while loop_ok:
    meter_row = sel_cur.fetchone()
if meter_row:
    yield meter_row
else:
    loop_ok = False
Is there an advantage to a database access generator function?