Register a routine written in C
To register a C routine, write the body of the routine, compile it, and create a shared-object file, and then use the CREATE FUNCTION or CREATE PROCEDURE statement to register the function. The RETURNING clause of CREATE FUNCTION specifies the return data type of the function.
CREATE FUNCTION equal (arg1 udtype1, arg2 udtype1)
RETURNING BOOLEAN
EXTERNAL NAME '/usr/lib/udtype1/lib/libbtype1.so(udtype1_equal)'
LANGUAGE C
END FUNCTION;
For more information, see the CREATE FUNCTION and CREATE PROCEDURE statements in the HCL OneDB™ Guide to SQL: Syntax. For information about how to create a shared-object file, refer to the HCL OneDB DataBlade® API Programmer's Guide.