Clauses and Keywords
- RETURNSclause
- 
(Required) specifies the output parameter returned by the function.A function is scalar, it returns one value (output parameter).The output parameter can be of any SQL type (except an array or an array element) or a null-terminated string ( CSTRING).The output parameter can be passed by reference (the default), by descriptor or by value.If theBY DESCRIPTORclause is specified, the output parameter is passed by descriptor.If theBY VALUEclause is specified, the output parameter is passed by value.
- PARAMETERkeyword
- 
specifies that the function returns the value from the parameter under number param_num.It is necessary if you need to return a value of data type BLOB.
- FREE_ITkeyword
- 
means that the memory allocated for storing the return value will be freed after the function is executed.It is used only if the memory was allocated dynamically in the UDF.In such a UDF, the memory must be allocated with the help of the ib_util_mallocfunction from theib_utilmodule, a requirement for compatibility with the functions used in Firebird code and in the code of the shipped UDF modules, for allocating and freeing memory.
- ENTRY_POINTclause
- 
specifies the name of the entry point (the name of the imported function), as exported from the module. 
- MODULE_NAMEclause
- 
defines the name of the module where the exported function is located.The link to the module should not be the full path and extension of the file, if that can be avoided.If the module is located in the default location (in the ../UDFsubdirectory of the Firebird server root) or in a location explicitly configured infirebird.conf, it makes it easier to move the database between different platforms.TheUDFAccessparameter in the firebird.conf file allows access restrictions to external functions modules to be configured.
Any user connected to the database can declare an external function (UDF).