Example: Stored Procedures with JSON Type Local Variables - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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;