【发布时间】:2021-11-25 03:06:46
【问题描述】:
我正在尝试使用 cx_Oracle 运行一条语句,但我一直遇到问题,它说 SQL 命令未正确结束,但在阅读文档后似乎这是正确的,但实际上它是不正确的。 cx_Oracle.DatabaseError: ORA-00933 SQL command not properly ended
vary = "'Y'"
dsn_tns = cx_Oracle.makedsn(hostName, port,
service_name=serviceName)
conn = cx_Oracle.connect(user=usr, password=__pswrd,
dsn=dsn_tns)
c = conn.cursor()
tempCheck = "'%{0}/%'".format(checkerAR)
statmentApp = 'SELECT TITLE,APP_URL from SOME.DATABASE' \
'WHERE UPPER(APP_URL) LIKE UPPER(:tc)' \
'AND ACTIVE_FLAG = :y'
c.execute(statmentApp,tc = tempCheck , y = vary)
c.execute 行是错误被标记的地方。我试图在语句中输入tempCheck,因为我想在 SQL 语句中添加通配符。
我在这里做错了什么?
【问题讨论】:
标签: python-3.x cx-oracle