15.10 - Example: UDM with Parameter Style TD_GENERAL - Teradata Database

Teradata Database Teradata JSON

Product
Teradata Database
Release Number
15.10
Published
December 2015
Language
English (United States)
Last Update
2018-06-05
dita:mapPath
TeradataJSON_15_10.ditamap
dita:ditavalPath
ft:empty

The example shows an SQL definition for a UDM using parameter style TD_GENERAL with a JSON parameter, and a C function that defines the method.

/* Parameter style TD_GENERAL */

CREATE INSTANCE METHOD JSONMethod (p1 JSON(100))
FOR Some_UDT
RETURNS INTEGER
	FOR Some_UDT
	NO SQL
	PARAMETER STYLE TD_GENERAL
	DETERMINISTIC
	LANGUAGE C
	EXTERNAL NAME 'CS!JSONMethod!JSONMethod.c!F!JSONMethod';
/* C source file name: JSONMethod.c */

void JSONMethod (	
     UDT_HANDLE     *someUdt,
     JSON_HANDLE    *jsonval, 
     INTEGER        *result,
     char           sqlstate[6])
{
   /* body function */
}