on 09-15-2022 11:03 AM
Hi, SQL Anywhere 17.0.11.7058
We have a database with CHAR encoding set Western Latin 1252, and NCHAR encoding set UTF-8 which is giving us a problem when we are exporting some NVARCHAR non-English characters. We are doing this by using UNLOAD SELECT XMLGEN call on a SELECT query to save the results of the query in XML format.
We get the error message
Control character in XML output
SQLCODE=-911, ODBC 3 State = "HY000"
Our procedure calls a statement
EXECUTE IMMEDIATE 'UNLOAD SELECT XMLGEN( ''<?xml version="1.0" encoding="UTF-8" ?><Root>{$x}</Root>'',
SELECT field1, field2 etc etc...
for xml auto, elements) AS x ) TO ' + filepath_filename + ' ENCODING ''UTF-8'' format ASCII quotes off escapes off';
and if any of the fields we are selecting gets a non-English character, we get the above message.
Curiously, when I try it on the copy of the database which has both CHAR and NCHAR encoding sets of UTF-8, then no problems at all - XML file is output and saved with all sorts of non-English characters without any problems.
But I'd prefer to keep CHAR encoding set of Latin1252 / NCHAR of UTF-8 if possible, so I'd like to see if I can resolve the above problem?
Cheers
Hi Chris, yes, same question. At the time when I posted here, there wasn't a lot of info on the other SQL Anywhere forum. Googling brought me here so I'd figure I'd try here as well.
No worries, I will use that other forum in the future. THanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.