15.10 - Example: UNICODE Combine LATIN - Teradata Database

Teradata Database Teradata JSON

Product
Teradata Database
Release Number
15.10
Published
December 2015
Language
English (United States)
Last Update
2018-06-05
dita:mapPath
TeradataJSON_15_10.ditamap
dita:ditavalPath
ft:empty
The example shows how to use the JSON Combine method to combine two JSON objects, one of CHARACTER SET UNICODE and the other of CHARACTER SET LATIN, which results in a JSON instance with text in CHARACTER SET UNICODE. This example also uses the 'OBJECT' parameter to specify a JSON object as the result.
The example uses the table(s) created earlier.
/* Explicit statement of result type as JSON 'OBJECT' */

SELECT edata.Combine(edata2, 'OBJECT') FROM my_table WHERE eno < 3;

Result: When combining LATIN and UNICODE, the result is a JSON instance with text in CHARACTER SET UNICODE.

edata.Combine(edata2)
---------------------
{"name" : "Cameron", "name" : "Lewis"}
{"name" : "Melissa", "name" : "Lewis"}