I am getting the error cx_Oracle.DatabaseError: ORA-00933: SQL command not properly ended
when trying to run the following code. I have used
import cx_Oracle
ip = '127.0.0.1'
port = 1234
SID = 'abcd'
dsn_tns = cx_Oracle.makedsn(ip, port, SID)
conn = cx_Oracle.connect('username', 'password', dsn_tns)
curs = conn.cursor()
curs.execute('select sysdate from dual;') # Error is here
curs.close()
conn.close()
Running the following works as expected:
conn = cx_Oracle.connect('username', 'password', dsn_tns)
print (conn.version)
conn.close()
ORA-00933: SQL command not properly ended
in all cases. – Baumbaugh