on 2024 Mar 27 9:08 AM
Hi,
we upgraded a database from version 11 to version 17 build 17.0.11.7672 and from windows1252-charset to UTF8-charset and we come across some problems writing data to a new proxy database (also version 17 build 17.0.11.7672).
Both databases version 17 are using UTF8-charset and UCA-collation.
When inserting a string into a remote column with datatype "long nvarchar", the data is converted on the proxy table into "UTF-16 Little Endian" (this is what Notepad++ is saying) and the data is corrupted for our work. Previously we used the database version 11 (windows1252-charset and 1252LATIN1-collation) to connect to database version 17 proxy and there were no problems inserting long nvarchar strings.
Please follow the parts to reproduce the problem:
--new database version 17 build 17.0.11.7672 (UTF8 / UCA)
create or replace table testSQLANY17_UCA( testval long nvarchar not null, insertTimestamp timestamp not null default current timestamp );
--Upgraded database version 17 build 17.0.11.7672 (UTF8 / UCA)
declare local temporary table #a(testval long nvarchar); declare @txt long nvarchar; drop table if exists remote_testSQLANY17_UCA; create existing table remote_testSQLANY17_UCA AT 'SQLANY17_ODBC;;DBA;testSQLANY17_UCA'; set @txt = 'ThisIsOneTestStringWith30Chars'; insert into #a with auto name select @txt as testval; insert into remote_testSQLANY17_UCA with auto name select @txt as testval; select testval,length(testval) from #a; select top 5 testval,length(testval), cast(csconvert(testval,'nchar_charset','utf16') as long nvarchar) y, length(y), insertTimestamp from remote_testSQLANY17_uca order by insertTimestamp desc;
After inserting a long nvarchar string with length of 30 chars into the remote and local table the testval in the remote table is getting length of 60 chars and the length in the local table is staying with 30 chars. As you can see the testval in remote table is converted from utf16 to nchar and the length is correct again.
What is wrong now? Is there an option, which we can set to get the old behavior in version 11 or what can we do, so the string in the proxy-table will get the length of 30 chars, like the inserted string?
Many thanks in advance, Christian
User | Count |
---|---|
75 | |
9 | |
9 | |
8 | |
8 | |
7 | |
7 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.