Register the UDA with the Netezza Performance Server system
If you choose to compile but not register your UDAs with the nzudxcompile command, you must register the UDA by using the CREATE AGGREGATE command.
When you issue a CREATE AGGREGATE command, the database processes the HOST OBJECT and the SPU OBJECT files as the user nz. The user nz must have read access to the object files and read and execute access to every directory in the path from the root to the object file.
CREATE AGGREGATE PENMAX(INT4) RETURNS INT4 STATE (INT4, INT4)
LANGUAGE CPP PARAMETER STYLE NPSGENERIC API VERSION 2
EXTERNAL CLASS NAME 'CPenMax'
EXTERNAL HOST OBJECT '/home/nz/udx_files/penmax.o_x86'
EXTERNAL SPU OBJECT '/home/nz/udx_files/penmax.o_spu10'If the command is successful, it creates the aggregate in the default database. The UDA will be owned by the user account that issues the SQL command. To create an aggregate, your user account must have Create Aggregate privilege, or you must be logged in as the admin user, the owner of the database, or the owner of the schema. For the aggregate name, you can specify a name such as schema.aggname (for example, schema.PENMAX(INT4) to create the UDA in a specific schema in the current database. You can specify a database name, but the name must be the same as the current database. Cross-database writes are not supported.