DECLARE EXTERNAL FUNCTION
Declares a user-defined function (UDF) in the current database
DSQL, ESQL
DECLARE EXTERNAL FUNCTION funcname [{ <arg_desc_list> | ( <arg_desc_list> ) }] RETURNS { <return_value> | ( <return_value> ) } ENTRY_POINT 'entry_point' MODULE_NAME 'library_name' <arg_desc_list> ::= <arg_type_decl> [, <arg_type_decl> ...] <arg_type_decl> ::= <udf_data_type> [BY {DESCRIPTOR | SCALAR_ARRAY} | NULL] <udf_data_type> ::= <scalar_datatype> | BLOB | CSTRING(length) [ CHARACTER SET charset ] <scalar_datatype> ::= !! See Scalar Data Types Syntax !! <return_value> ::= { <udf_data_type> | PARAMETER param_num } [{ BY VALUE | BY DESCRIPTOR [FREE_IT] | FREE_IT }]
Parameter | Description |
---|---|
funcname |
Function name in the database.The maximum length is 63 characters.It should be unique among all internal and external function names in the database and need not be the same name as the name exported from the UDF library via |
entry_point |
The exported name of the function |
library_name |
The name of the module ( |
length |
The maximum length of a null-terminated string, specified in bytes |
charset |
Character set of the CSTRING |
param_num |
The number of the input parameter, numbered from 1 in the list of input parameters in the declaration, describing the data type that will be returned by the function |
The DECLARE EXTERNAL FUNCTION
statement makes a user-defined function available in the database.UDF declarations must be made in each database that is going to use them.There is no need to declare UDFs that will never be used.
The name of the external function must be unique among all function names.It may be different from the exported name of the function, as specified in the ENTRY_POINT
argument.