Adding the encoding parameter to the connection string did do the trick.
With this now my test code is running perfectly fine, rendering the results
as expected.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please
Alternatively, this will probably work as well, SQLAlchemy will pass it through
to the client:
create_engine("oracle+cx_oracle://user:pass@dsn/?encoding=utf-8")
will update the docs now.
>>> e =
>>> create_engine("oracle+cx_oracle://scott:tiger@oracle1120/?encoding=utf-8")
>>>
I see you are using an "encoding" on cx_Oracle connect(), which SQLAlchemy does
not use; this parameter appears to be added to cx_Oracle only recently.
The standard way to set Oracle encodings is via the NLS_LANG environment
variable, please use this parameter when dealing with Oracle client
Engine object configuration
- convert_unicode = False
- cx_oracle_ver = (7, 3, 0)
- driver = cx_oracle
- encoding = UTF8
- nencoding =
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an
What are the values of "encoding" and "nencoding" on the connection object?
https://github.com/oracle/python-cx_Oracle/issues/36
https://stackoverflow.com/a/37600367/395053
You probably need to grab the raw dbapi connection:
##
Traceback (most recent call last):
File "/data/projects/Python/database/sqlalchemy/sqlalchemy_oracle.py",
line 45, in
df = pd.read_sql_query(u'SELECT owner, table_name FROM all_tables
WHERE owner LIKE \'äöüßÄÖÜœ\'',
##
Traceback (most recent call last):
File "/data/projects/Python/database/sqlalchemy/sqlalchemy_oracle.py",
line 45, in
df = pd.read_sql_query(u'SELECT owner, table_name FROM all_tables
WHERE owner LIKE \'äöüßÄÖÜœ\'',