Is there a way to see if the SELECT in cx_Oracle didn't return anything?
I don't understand your problem - if your select doesn't return
anything, the fetch* methods on the cursor will tell you if there is any
data to expect at all. Additionally there is teh rowcount-property that
holds the number of rows the last execute* yielded.
This is a simplification of the program
c = db.cursor()
while 1:
c.execute('select ....')
smtp = SMTP(MAIL_HOST, 25, 'localhost')
for address, subject, body in c:
smtp.sendmail(....)
smtp.quit()
time.sleep(60)
now if the select doesn't return any rows, there's no need to connect to the
mail server. I'd like to avoid that unnecessary step.
c.rowcount will not give me the number of rows selected, it will only give
me the number of rows already fetched.