ODBC driver error during SELECT query for string data type

classic Classic list List threaded Threaded
4 messages Options
rishi007bansod rishi007bansod
Reply | Threaded
Open this post in threaded view
|

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
Igor Sapego Igor Sapego
Reply | Threaded
Open this post in threaded view
|

Re: ODBC driver error during SELECT query for string data type

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 <[hidden email]> 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.

rishi007bansod rishi007bansod
Reply | Threaded
Open this post in threaded view
|

Re: ODBC driver error during SELECT query for string data type

setting decoder to 'utf8' solved my problem
Igor Sapego Igor Sapego
Reply | Threaded
Open this post in threaded view
|

Re: ODBC driver error during SELECT query for string data type

I'm glad it helped.

Best Regards,
Igor

On Mon, May 22, 2017 at 7:28 AM, rishi007bansod <[hidden email]> 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.