Example: ExistValue Does Not Find the Specified Child

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

The following query results in 'True' if the JSON column contains a child named 'schools' which is an array, and the second element of the array has a child named 'location'.

SELECT eno, 'True'
FROM my_table
WHERE edata.ExistValue('$.schools[1].location') = 1;

Result:

*** No rows found ***

The JSON column contains a child named 'schools' which is an array, and the second element of the array does not have a child named 'location'; therefore, the method did not return any rows.