15.10 - Example: JSONExtractValue with Multiple Results Error - Teradata Database

Teradata Database Teradata JSON

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1150-151K

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