Example: Use ExistValue to Check for a Specific Child

Teradata Vantageā„¢ JSON Data Type

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 'type'.

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

Result:

   ENO    'True'
------------------
   1      True