The CREATE FUNCTION statement registers user-defined functions
in the database. The CREATE PROCEDURE statement registers user-defined
procedures in the database. These functions store information about
the UDR in the sysprocedures system catalog table.
Registration for a C UDR requires the following special clauses
of the CREATE FUNCTION and CREATE PROCEDURE statements to help the
database server identify the routine:
The required EXTERNAL NAME clause specifies the path to the shared-object
file that contains the compiled C code for the UDR.
The required LANGUAGE clause specifies the language in which the
body of the UDR is written.
The optional WITH clause specifies the routine modifiers for the
UDR.
For example, the following figure shows a CREATE FUNCTION statement
that registers a user-defined function named abs_eq() whose
corresponding C function is in a shared-object file named abs.so. Figure 1. Registering a C UDR
Tip: The
BladeSmith development tool, which is part of the Informix®DataBlade® Developers Kit (DBDK), automatically
generates a file with the SQL statements needed to register a DataBlade®.
The BladeManager development tool can install and register a DataBlade® module.
For more information, see the HCL®Informix®DataBlade® Developers Kit User's Guide.