Registering a User-Defined Procedure
About this task
This example registers a C user-defined procedure named check_owner(
) that takes one argument of the type LVARCHAR. The external routine
reference specifies the path to the C shared library where the procedure
object code is stored. This library contains a C function unix_owner(
), which is invoked during execution of the check_owner( ) procedure.
CREATE PROCEDURE check_owner ( owner lvarchar )
EXTERNAL NAME "/usr/lib/ext_lib/genlib.so(unix_owner)"
LANGUAGE C
END PROCEDURE;
This example registers a user-defined
procedure named showusers( ) that is written in the Java™ language:
CREATE PROCEDURE showusers()
WITH (CLASS = "jvp") EXTERNAL NAME 'admin_jar:admin.showusers'
LANGUAGE JAVA;
The EXTERNAL NAME clause specifies that the Java™ implementation of the showusers( ) procedure is a method called showusers( ), which resides in the admin Java™ class that resides in the admin_jar JAR file.