toJSON Method | DATASET Data Type | Teradata Vantage - 17.10 - toJSON - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - DATASET Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1198-171K
Language
English (United States)

toJSON converts any DATASET data type instance into a JSON text instance.

Result Type

toJSON returns a JSON-encoded Avro or CSV value. The character set of the resulting JSON object is always UNICODE.

CSV values can contain multiple records, so the JSON value is an array of objects where each object contains the fields in a CSV record. For empty fields, the value equals the JSON null value. The resulting JSON object is in the same character set as the CSV value.

If there is no header record or schema with field names, default CSV field names generate. For defined field names with a record containing more than fields, default field names generate for the extra fields in the record. For example, if three field names are defined and a record contains four fields, the fourth field is named csv_fld4.