Estoy armando un script en python:
#!/usr/bin/python2.6
import os
import cx_Oracle
import csv
SQL="SELECT count(status) status FROM v'$'session GROUP BY status"
# You can set these in system variables but just in case you didnt
os.putenv('ORACLE_HOME', '/oracle/product/10.2.0/db_1')
os.putenv('LD_LIBRARY_PATH', '/oracle/product/10.2.0/db_1/lib')
connection = cx_Oracle.connect('XXX/XXX:XXX/XXX')
cursor = connection.cursor()
cursor.execute(SQL)
for row in cursor:
print row
cursor.close()
connection.close()
FILE.close()
y me devuelve el error ORA-00933, diciendo que esta mal finalizada la query.