Read and parse JSON in SQL / Teradata

visibility 1,533 access_time 4 years ago languageEnglish timeline Stats
timeline Stats
Page index 1.43

JSON is commonly used in modern applications for data storage and transfers. Pretty much all programming languages provide APIs to parse JSON. 

From Teradata version 15.0, JSON shredding functions are added. JSONExtractValue function can be used to extract JSON data from JSON object.  NEW JSON can be used to convert string to JSON object. 

In Teradata JSON native data type is also supported. Shredding functions allow you to extract vJSON documents up to 16MB in size. 

Code snippet

SELECT jsonObj.Name AS Name,
    jsonObj.JSONExtractValue('$.Value') AS "Value"
    FROM
    (
    SELECT NEW json('{"Name":"A","Value":2}') AS jsonObj) AS r;
info Last modified by Raymond 4 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
Create, Drop, Alter and Use Database - Hive SQL
visibility 1,062
thumb_up 0
access_time 2 years ago
Teradata RPAD - Right Padding
visibility 598
thumb_up 0
access_time 2 years ago