Firebird Documentation Index → Firebird 1.5.6 Release Notes → Miscellaneous Enhancements → External Functions (UDFs) |
User-defined functions.-
rpad (instring, length, padcharacter)
Right-pads the supplied string instring
by appending padcharacters until the
result string has the given length
.
The input string can be any length less than 32766 bytes. Length must not exceed 32765 bytes.
Declaration
DECLARE EXTERNAL FUNCTION rpad CSTRING(80), INTEGER, CSTRING(1) RETURNS CSTRING(80) FREE_IT ENTRY_POINT 'IB_UDF_rpad' MODULE_NAME 'ib_udf';
lpad (instring, length, padcharacter)
Left-pads the supplied string instring by prepending padcharacters until the result string has the
given length
.
The input string can be any length less than 32766 bytes. Length must not exceed 32765 bytes.
Declaration
DECLARE EXTERNAL FUNCTION lpad CSTRING(80), INTEGER, CSTRING(1) RETURNS CSTRING(80) FREE_IT ENTRY_POINT 'IB_UDF_lpad' MODULE_NAME 'ib_udf';
log (x, y)
This function had an old bug, whereby the arguments x and y were erroneously reversed. It should return the logarithm base x of y but in fact it returned the log base y of x. It has been corrected.
If it was used in your applications previously, PLEASE CHECK YOUR APPLICATION CODE! it either returned the wrong results; or someone, at some point, did a workaround and reversed the arguments deliberately in order to get the right calculation.
Changes in Firebird 1.5 affect functions in the fbudf external function library, as follows.-
The *NVL and *NULLIF functions remain for backward compatibility, but are deprecated by the introduction of the new internal functions CASE, COALESCE and NULLIF.
If you are porting a database that was created in Firebird 1.0.x and you declared the fbudf functions truncate and round, those declarations will no longer work with Firebird 1.5 because the entry_point names were changed. You will need to drop the functions and redeclare them, using the declarations from the fbudf.sql script in the 1.5 /UDF directory.
Note that fbudf cannot handle string fields bigger than (32Kb - 1) bytes in length. This limit may have ill effects where strings are concatenated before being passed to UDFs taking string arguments. If the sum of field is beyond the limit, the behavior is undefined. The function may return a nonsense result or the fbudf code may perform an illegal operation.
Firebird Documentation Index → Firebird 1.5.6 Release Notes → Miscellaneous Enhancements → External Functions (UDFs) |