ARRAY_TO_JSON JSON Function | VantageCloud Lake - ARRAY_TO_JSON - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The ARRAY_TO_JSON function converts a Vantage ARRAY type to a JSON type composed of an ARRAY.

The ARRAY_TO_JSON function only converts Vantage ARRAY types to the JSON type stored as text.

The ARRAY data type is mapped to a JSON-formatted string composed of an array, which can also be a multidimensional array. If the data type of the ARRAY is a numeric predefined type, the array element maps to a numeric type in the JSON instance. For all other types, the value added to the JSON instance is the transformed value of each element of the ARRAY, which is stored in the JSON instance as a string. The JSON array must have the same number of elements as the ARRAY type.

The return type of this function is JSON.

ARRAY_TO_JSON returns NULL if the ARRAY_expr argument is null.