I am getting one of 2 errors and I don't know why. They are ORA-00911: invalid character and ORA-00933: (something about the statement not ended correctly). I am hoping a fresh set of eyes can help with it. Here is the code: orcl = cx_Oracle.connect("xyz/xyz@xyz")
curs = orcl.cursor()
database = "Database Connections\\xyz.sde\\xyz.xyz_xyz"
sql1 = "create view RSIDs as "
sql2 = "select * "
sql3 = "from "+database+" where "
sql4 = "xyz like '%RSID%' or xyz like '%m%'"
sql = str(sql1+sql2+sql3+sql4)
print sql
curs.execute(sql)
curs.close()
orcl.close()
The put x's in for the sensitive stuff but left all the slashes, comma, quotes etc... the way I have them. I tried several different ways with the slashes because I know python is funny with them but I can't get it to create the view. The statement works in SQLPLus. I am using Python 2.7. Any help is appreciated.