You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by rishi007bansod <ri...@gmail.com> on 2017/05/19 11:45:40 UTC
ODBC driver error during SELECT query for string data type
Hi,
While fetching string fields using ODBC driver from ignite cache in
python, I am getting following error,
Traceback (most recent call last):
File "pythonOdbc.py", line 13, in <module>
row = cursor.fetchone()
UnicodeDecodeError: 'utf16' codec can't decode byte 0x00 in position 2:
truncated data
ODBC connection string i have used is :
connection_string=
'DRIVER=/usr/local/lib/libignite-odbc.so;ADDRESS=localhost:10800;CACHE=Person'
Is there any encoding parameter that I need to set to remove above error?
Thanks
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/ODBC-driver-error-during-SELECT-query-for-string-data-type-tp13024.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: ODBC driver error during SELECT query for string data type
Posted by Igor Sapego <is...@gridgain.com>.
I'm glad it helped.
Best Regards,
Igor
On Mon, May 22, 2017 at 7:28 AM, rishi007bansod <ri...@gmail.com>
wrote:
> setting decoder to 'utf8' solved my problem
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/ODBC-driver-error-during-SELECT-
> query-for-string-data-type-tp13024p13051.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
Re: ODBC driver error during SELECT query for string data type
Posted by rishi007bansod <ri...@gmail.com>.
setting decoder to 'utf8' solved my problem
--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/ODBC-driver-error-during-SELECT-query-for-string-data-type-tp13024p13051.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Re: ODBC driver error during SELECT query for string data type
Posted by Igor Sapego <is...@gridgain.com>.
Hi,
Can you provide a bit more info about your code and library you have used
to connect to ODBC?
We have not tested our driver with python so it seems very interesting, but
the only thing I can point you to right now is that our ODBC driver uses
UTF-8, not UTF-16 encoding. I'm not sure if encoding is specified in
application or library code though.
Best Regards,
Igor
On Fri, May 19, 2017 at 2:45 PM, rishi007bansod <ri...@gmail.com>
wrote:
> Hi,
> While fetching string fields using ODBC driver from ignite cache in
> python, I am getting following error,
>
> Traceback (most recent call last):
> File "pythonOdbc.py", line 13, in <module>
> row = cursor.fetchone()
> UnicodeDecodeError: 'utf16' codec can't decode byte 0x00 in position 2:
> truncated data
>
>
> ODBC connection string i have used is :
> connection_string=
> 'DRIVER=/usr/local/lib/libignite-odbc.so;ADDRESS=
> localhost:10800;CACHE=Person'
>
> Is there any encoding parameter that I need to set to remove above error?
>
> Thanks
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/ODBC-driver-error-during-SELECT-
> query-for-string-data-type-tp13024.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>