Example: UNICODE Combine LATIN - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
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 produces 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"}