Example: ExistValue Does Not Find the Specified Child - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The following query returns 'True' if the JSON column has a child named 'schools' that is an array whose second element 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.