Example: JSONExtractValue with Multiple Results Error

Teradata Vantageā„¢ JSON Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K

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 ***