How to perform a subquery??
Eduardo Nascimento <[email protected]> Tue, 6 Oct 2015 17:25:48 -0300
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Message-ID | <CAJb1bFxfG5MxnwD=zUtVbmevAyV-Z9+XOVKLgofKnjE-oNoMdQ@mail.gmail.com> |
Gentlemen, good afternoon! I newbie on the list in python and oracle. I'm making a script that performs a query and report this query via email. My question is how to do a subquery, every time is like a subquery displays an error: DatabaseError: ORA-00936: missing expression Attached the file that I am using sql and script in python. Could help me with this issue? ------------------------------------------------------------------------------ _______________________________________________ cx-oracle-users mailing list cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
sendmail.py
(text/plain, 479 B)
## Performs connected query and results by sending e-mail
import smtplib
import cx_Oracle
con = cx_Oracle.connect('edu/[email protected]/sample')
cursor = con.cursor()
cursor.execute(file('C:\QUERY.sql').read())
rs = cursor.fetchall()
print(rs)
smtpObj = smtplib.SMTP_SSL('mail.labtec.com',465)
smtpObj.ehlo()
smtpObj.login('[email protected].','xxxx')
smtpObj.sendmail('[email protected]','[email protected]',str(rs) )
smtpObj.quit()
query.sql
(application/octet-stream, 4.1 KB) - not displayed