Other UDFs in the same database that use the global1 code declare the general global function as external:
/***** Source code filename: udf2.c *****/ #define SQL_TEXT Latin_Text #include <sqltypes_td.h> external global1(char *text1); void udf2(VARCHAR *b, INTEGER *result, ... ) { int global_result; global_result = global1(b); ... }
The corresponding CREATE FUNCTION statement only has to specify the source for the UDF:
CREATE FUNCTION UDF1(B VARCHAR(20000) CHARACTER SET LATIN) RETURNS INTEGER ... EXTERNAL NAME 'CS!udf2!udf2.c';
The code for the general global function had to be provided only once, and can be shared by all other UDFs in the same library that provide the external statement.