Register generic UDXs

When you register a generic UDX by using the CREATE [OR REPLACE] command, you use the keyword ANY to declare character or numeric data types as generic.

The following is an example for a UDF:
MYDB.SCHEMA(MYUSER)=> CREATE FUNCTION number(num NUMERIC(ANY))
RETURNS NUMERIC(ANY) LANGUAGE CPP PARAMETER STYLE NPSGENERIC 
EXTERNAL CLASS NAME 'Nnumber' 
EXTERNAL HOST OBJECT '/home/nz/udx_files/number.o_x86' 
EXTERNAL SPU OBJECT '/home/nz/udx_files/number.o_spu10';

In this example, the number() function takes an input numeric data type of any valid size and returns a numeric data type of a valid size that is calculated by the UDF.

The following is an example for a UDA. UDAs allow generic arguments only.
CREATE OR REPLACE AGGREGATE char20 (CHAR(ANY))
RETURNS CHAR(20) STATE (CHAR(20))
LANGUAGE CPP PARAMETER STYLE NPSGENERIC
EXTERNAL CLASS NAME 'Char20'
EXTERNAL HOST OBJECT '/tmp/udx_test/UDX_CharMax.o_x86'
EXTERNAL SPU OBJECT '/tmp/udx_test/UDX_CharMax.o_spu10';

UDAs that have large string state variables can negatively affect performance.