ARRAY_TO_JSON JSON Function | Teradata Vantage - ARRAY_TO_JSON - Advanced SQL Engine - Teradata Database

JSON Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
gzn1554761068186.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1150
lifecycle
previous
Product Category
Teradata Vantageā„¢

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. Note, the JSON array should 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.