Data truncation by Microsoft ODBC driver for NVARCHAR
Jan Murre <[email protected]> Tue, 26 Sep 2017 15:08:53 +0200
| Newsgroups | gmane.comp.python.egenix.user |
|---|---|
| Message-ID | <CAE_3tvrJXOusSovKY+2U7zFrbkUoJrcyfhx0+9Sq+S7JhZd76w@mail.gmail.com> |
--===============09592590387769695==
Content-Type: multipart/alternative; boundary="001a113c67d681b535055a176085"
--001a113c67d681b535055a176085
Content-Type: text/plain; charset="UTF-8"
Hi,
I am query-ing a MS SQL database from Redhat Linux using the "Microsoft
ODBC Driver 13 for SQL Server".
There is a NVARCHAR(30) field in our database that is filled with data
having a 2-byte utf-8 char on the last position. When query-ing, the ODBC
driver issues this warning:
mx.ODBC.Error.Warning: ('01004', 0, '[Microsoft][ODBC Driver 13 for SQL
Server]String data, right truncation', 8668)
This results in corrupted data in the resultsset, because only the first
byte of this 2-byte utf-8 char is in the column.
I tried with serveral settings for 'connection.encoding' and
'connections.stringformat', but without success.
Is this an ODBC driver issue? Would it be possible to work around this with
certain settings of mxODBC?
Regards, Jan
--001a113c67d681b535055a176085
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div><div>Hi,<br><br></div>I am query-ing a MS SQL da=
tabase from Redhat Linux using the "Microsoft ODBC Driver 13 for SQL S=
erver".<br><br></div>There is a NVARCHAR(30) field in our database tha=
t is filled with data having a 2-byte utf-8 char on the last position. When=
query-ing, the ODBC driver issues this warning:<br><br>mx.ODBC.Error.Warni=
ng: ('01004', 0, '[Microsoft][ODBC Driver 13 for SQL Server]Str=
ing data, right truncation', 8668)<br><br></div><div>This results in co=
rrupted data in the resultsset, because only the first byte of this 2-byte =
utf-8 char is in the column.</div><div><br></div><div>I tried with serveral=
settings for 'connection.encoding' and 'connections.stringform=
at', but without success.</div><div><br></div><div>Is this an ODBC driv=
er issue? Would it be possible to work around this with certain settings of=
mxODBC?</div><div><br></div><div>Regards, Jan</div><div><br></div><div><br=
></div></div>
--001a113c67d681b535055a176085--
--===============09592590387769695==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
_______________________________________________________________________
eGenix.com User Mailing List http://www.egenix.com/
https://www.egenix.com/mailman/listinfo/egenix-users
--===============09592590387769695==--