[英]SQLAlchemy + cx_oracle and special characters
I'm attempting to connect to an oracle db with SQLAlchemmy:我正在尝试使用 SQLAlchemmy 连接到一个 oracle 数据库:
import sqlalchemy
oracle_db = sqlalchemy.create_engine('oracle+cx_oracle://user:passwd@host:port/schema')
connection = oracle_db.connect()
result = connection.execute("SELECT sysdate from dual")
for row in result:
print(row)
However I'm getting the following error on line 3:但是我在第 3 行收到以下错误:
TypeError: makedsn() takes no keyword arguments
Is there something wrong with this?这有什么问题吗?
Important note (please don't ask why): the password is something among the lines of:重要说明(请不要问为什么):密码是以下几行之一:
A(sdf)1234
Do the parenthesis cause this?括号会导致这个吗?
That error implies you are using an older version of cx_Oracle.该错误意味着您使用的是旧版本的 cx_Oracle。 Keyword parameters were added to that method in 5.1.1.
在 5.1.1 中向该方法添加了关键字参数。 The latest version is 5.2.1 which you can acquire from here:
最新版本是 5.2.1,您可以从这里获取:
https://pypi.python.org/pypi/cx_Oracle/ https://pypi.python.org/pypi/cx_Oracle/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.