Note
|
External functions (UDFs) have been aggressively deprecated in Firebird 4.0:
-
The default setting for the configuration parameter UdfAccess is None .To use UDFs now requires an explicit configuration of Restrict path-list
-
The UDF libraries (ib_udf , fbudf ) are no longer distributed in the installation kits
-
Most of the functions in the libraries previously distributed in the shared (dynamic) libraries ib_udf and fbudf have already been replaced with built-in functions.A few remaining UDFs have been replaced with either compatible routines in a new library of UDRs named udf_compat or converted to stored functions.
Refer to Deprecation of External Functions (UDFs) in the Compatibility chapter of the Firebird 4.0 Release notes for details and instructions about upgrading to use the safe functions.
-
Replacement of UDFs with UDRs or stored functions is strongly recommended
|
External functions, also known as “User-Defined Functions” (UDFs) are programs written in an external programming language and stored in dynamically loaded libraries.Once declared in a database, they become available in dynamic and procedural statements as though they were implemented in the SQL language.
External functions extend the possibilities for processing data with SQL considerably.To make a function available to a database, it is declared using the statement DECLARE EXTERNAL FUNCTION
.
The library containing a function is loaded when any function included in it is called.
Note
|
External functions declared as DECLARE EXTERNAL FUNCTION are a legacy from previous versions of Firebird.Their capabilities are inferior to the capabilities of the new type of external functions, UDR (User-Defined Routine).Such functions are declared as CREATE FUNCTION … EXTERNAL … .See CREATE FUNCTION for details.
|
Note
|
External functions may be contained in more than one library — or “module”, as it is referred to in the syntax.
|
Caution
|
UDFs are fundamentally insecure.We recommend avoiding their use whenever possible, and disabling UDFs in your database configuration (UdfAccess = None in firebird.conf ; this is the default since Firebird 4).If you do need to call native code from your database, use a UDR external engine instead.
|