How to do it...

  1. Connect to Teradata using SQLA or Studio.
  2. Create the following JSON table in your database:
CREATE VOLATILE TABLE JSON_TBL
(
EMP_id INTEGER, J1 JSON(1000)
)on commit preserve rows
;
  1. Let's insert values into it:
INSERT INTO JSON_TBL VALUES
(1, NEW JSON('{"name" : "Roberts", "Month" : 1}')); 
  1. Let's see the snippet from SQLA:
  1. Now we will SELECT data from table we have created. The output will be written to the file on your desktop, as JSON data is stored in LOB. The following would be the output. Press Cancel to display the result in the result set in SQLA:
  1. Following would be the result set, when you press Cancel:
  1. Let's collect statistics on the JSON column using the following code:
/*Collect stats on JSON column*/
COLLECT
STATISTICS COLUMN J1.name AS json_name_stats ON JSON_TBL
  1. Let's do a help statistics as follows and check the output: