Example: UDF 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

This example shows an SQL definition for a UDF using parameter style TD_GENERAL with a JSON parameter, and a C function that shows the corresponding parameter list.

/* Parameter Style TD_GENERAL */

CREATE FUNCTION MyJSONUDF2 (a1 JSON(100))  
                    RETURNS VARCHAR(100)
NO SQL
PARAMETER STYLE TD_GENERAL
DETERMINISTIC
LANGUAGE C
EXTERNAL NAME 'CS!MyJSONUDF2!MyJSONUDF2.c!F!MyJSONUDF2';
/* C source file name: myJSONUDF.c */

void MyJSONUDF2 (
     JSON_HANDLE    *json_handle, 
     VARCHAR_LATIN  *result, 
     char           sqlstate[6]
{
  /* body function */
}