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"}