To create a shared-object file for a C UDR:
- Create a shared-object file and put the UDR object file
(.o file) into this shared-object file.
You
can put C functions for related UDRs into the same shared-object file.
However, the name of each C function must be unique within the shared-object
file.
- Put the shared-object file in a directory on which the
user informix has read permission and the shared-object owner
has write permission.
The shared-object file must not
have permissions that allow any user other than user informix to
have write permission.
- Specify the path of the shared-object file in the EXTERNAL
NAME clause of the CREATE FUNCTION (or CREATE PROCEDURE) statement
when you register the C UDR.
The shared-object file
does not have to exist before you register its path with CREATE FUNCTION
or CREATE PROCEDURE. However, at UDR runtime, the paths of the shared-object
file and the registered UDR must match for the database server to
locate the UDR.
Important: If a shared-object
file has write permission set to all, the database
server issues error -9793 and writes a message in the log file when
someone tries to execute any UDR in the shared object.
For
more information, see Execute a UDR.
For information about how to create a shared-object file, see the HCL
Informix® User-Defined Routines and Data Types Developer's
Guide.