Example: Stored Procedures with JSON Type Local Variables

Teradata Vantageā„¢ JSON Data Type

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K

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;