Hi,
When i pass a Non-ASCII string in where condition filter of an raw SQL
statement, the SQLALCHEMY showing below error during an execution of query
File
"/base/data/home/apps/s~ipaddress/versionnumber/flow/services/requestExport.py",
line 119, in getRecordsFromDB
instanceList = self.session.raw_table_join_query(metadata, baseQuery,
columns, orderBy = args['orderBy'], isDescending = args['isDescending'],
limit=5000, includeAttachments=args.get('includeAttachments'))
File
"/base/data/home/apps/s~ipaddress/versionnumber/orangescape/model/server/sql/SQLSession.py",
line 724, in raw_table_join_query
rs = self.getConnection().execute(sql)
File
"/base/data/home/apps/s~ipaddress/versionnumber/sqlalchemy/engine/base.py",
line 1294, in execute
params)
File
"/base/data/home/apps/s~ipaddress/versionnumber/sqlalchemy/engine/base.py",
line 1471, in _execute_text
statement, parameters
File
"/base/data/home/apps/s~ipaddress/versionnumber/sqlalchemy/engine/base.py",
line 1528, in _execute_context
context)
File
"/base/data/home/apps/s~ipaddress/versionnumber/sqlalchemy/engine/default.py",
line 325, in do_execute
cursor.execute(statement, parameters)
File
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py",
line 565, in execute
request.statement = _ConvertFormatToQmark(statement, args)
File
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/net/proto2/python/internal/python_message.py",
line 449, in setter
self._fields[field] = type_checker.CheckValue(new_value)
File
"/base/data/home/runtimes/python27/python27_lib/versions/1/google/net/proto2/python/internal/type_checkers.py",
line 151, in CheckValue
(proposed_value))
*ValueError: "SELECT po.id FROM purchaseorder as po where po.customername =
'Twójstarski'" t has type bytes, but isn't in 7-bit ASCII encoding.
Non-ASCII strings must be converted to unicode objects before being added.*
The below is the query i'm using
*SELECT po.id FROM purchaseorder as po where po.customername =
'Twójstarski'*
I tried passing the value has an unicode string, this time the query
getting executed properly but without any result set.
Please suggest me the way to deal with this Non-ASCII string.
Regards
Pravin B
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.