rodrigocf
rodrigocf

Reputation: 2099

SQLAlchemy + cx_oracle and special characters

I'm attempting to connect to an oracle db with SQLAlchemmy:

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:

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?

Upvotes: 1

Views: 522

Answers (1)

Anthony Tuininga
Anthony Tuininga

Reputation: 7086

That error implies you are using an older version of cx_Oracle. Keyword parameters were added to that method in 5.1.1. The latest version is 5.2.1 which you can acquire from here:

https://pypi.python.org/pypi/cx_Oracle/

Upvotes: 1

Related Questions