Here is the SQL definition of a VARCHARUDT distinct UDT.
CREATE TYPE VARCHARUDT AS VARCHAR(20000) FINAL;
The table AggrDataTable defines a VARCHARUDT column.
CREATE TABLE AggrDataTable (aggrID int, aggrName varcharudt);
The following CREATE FUNCTION statement installs the aggregate function:
CREATE FUNCTION udf_agch002002udt (parameter_1 VARCHARUDT) RETURNS VARCHARUDT CLASS AGGREGATE (20000) LANGUAGE C NO SQL EXTERNAL NAME 'CS!udf_agch002002udt!udf_agch002002udt.c' PARAMETER STYLE SQL;