15.10 - Example: JSONExtractValue with Multiple Results Error - 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

This example shows the warning and error message string returned when JSONExtractValue finds multiple results to extract. The query attempts to get the name of every school for each person.

JSONExtractLargeValue can be substituted for JSONExtractValue.
SELECT eno, edata.JSONExtractValue('$..schools..name')
FROM my_table 
ORDER BY 1;
Result:
*** Query completed. 4 rows found. 2 columns returned.  
*** Warning: 7548 More than one result per JSON instance found. 
*** Total elapsed time was 1 second. 

eno edata.JSONEXTRACTVALUE('$..schools..name')
--------------------------------------------------
1   *** ERROR MULTI RESULT ***
2   *** ERROR MULTI RESULT ***
3   *** ERROR MULTI RESULT ***
4   *** ERROR MULTI RESULT ***