Example: Stored Procedures with JSON Type Local Variables - Advanced SQL Engine - Teradata Database

JSON Data Type

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
uwa1591040057999.ditamap
dita:ditavalPath
uwa1591040057999.ditaval
dita:id
B035-1150
lifecycle
previous
Product Category
Teradata Vantageā„¢

The following stored procedure contains local variables, local1 and local2, that are of JSON type with a maximum length of 100. The local1 variable is initialized using the NEW JSON constructor method.

CREATE PROCEDURE TestJSON_TDSP1 
		(IN id INTEGER, OUT outName VARCHAR(20))  
BEGIN
DECLARE local1 JSON(100) DEFAULT 
   NEW JSON('{"name":"Cameron", "age":24}');
DECLARE local2 JSON(100);
;
...
END;