Register the shared library in a database
After you create the compiled objects for the host and SPU environment, connect to the SQL database and use the CREATE LIBRARY command to register the library in a database.
When you issue a CREATE LIBRARY 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.
MYDB.SCHEMA(USER)=> CREATE OR REPLACE LIBRARY myudxlib AUTOMATIC LOAD
EXTERNAL HOST OBJECT '/home/nz/libs/host/mylib.so'
EXTERNAL SPU OBJECT '/home/nz/libs/spu/mylib.so';
CREATE LIBRARYIf the command is successful, it creates the user-defined shared library in the default database. The user account that issues the SQL command owns the library. To create a library, your user account must have Create Library privilege, or you must be logged in as the admin user, the owner of the database, or the owner of the schema. For the library name, you can specify a name such as schema.libname (for example, schema.myudxlib to create the library 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.