Example: UDM with Parameter Style TD_GENERAL

Teradata Vantageā„¢ JSON Data Type

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

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 */
}