Example 6

The options ncr=non_ascii and ncr=non_server in ncr translate a character to an NCR only if it is either not ASCII or not in the default server character set. In this example, the expression concatenates ASCII string values with both the ASCII name column and the Unicode uvcol column. The result of this expression is a string that contains both ASCII and non-ASCII characters. In the generated SQLX XML document, only non-ASCII characters are translated to NCRs:

select name + '(' + uvcol + ')'  from example_I18N_table2>     
   for xml option 'ncr=non_ascii'
--------------------------------
<resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">    
  <row>        
   <C1>Arabic(&#x622;&#x623;&#x624;&#x625;&#x626;)</C1>    
  </row>    
  <row>        
   <C1>Hebrew(&#x5d2;&#x5d3;&#x5d4;&#x5d5;&#x5d6;)</C1>    
  </row>    <
  row>        
   <C1>Russian(&#x410;&#x411;&#x412;&#x413;&#x414;)</C1>    
  </row>
</resultset>

A browser displays the document showing the actual non-ASCII characters, respectively Arabic, Hebrew, and Russian.