15.10 - Example: Stored Procedures with JSON Type Local Variables - Teradata Database

Teradata Database Teradata JSON

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1150-151K

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;