Because
further development some of the FreeAdhocUDF functions are now
obsolete, because they are now in standard-vocabulary. (NOT from the
UDFs like ib_udf or fbudf).
It is suggested to use this build-in functions because they are
theoretically quicker and more save (every call of an UDF is a risk
to
crash the server).
Please
remember, that sometimes the syntax of the functions is
different to
FreeAdhocUDF!
InterBase
From InterBase 6.0
F_YEAR could be replaced with EXTRACT(YEAR FROM ...)
SELECT F_YEAR(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(YEAR FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_MONTH could be replaced with EXTRACT(MONTH FROM ...)
SELECT F_MONTH(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(MONTH FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_DAYOFMONTH could be replaced with EXTRACT(DAY FROM ...)
SELECT F_DAYOFMONTH(CURRENT_TIMESTAMP)
FROM RDB$DATABASE;
is identical with
SELECT EXTRACT(DAY FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_HOUR could be replaced with EXTRACT(HOUR FROM ...)
SELECT F_HOUR(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(HOUR FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_MINUTE could be replaced with EXTRACT(MINUTE FROM ...)
SELECT F_MINUTE(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(MINUTE FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_SECOND could be replaced with EXTRACT(SECOND FROM ...)
SELECT F_SECOND(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(SECOND FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_DAYOFWEEK could be replaced with EXTRACT(WEEKDAY FROM ...)
SELECT F_DAYOFWEEK(CURRENT_TIMESTAMP)
FROM RDB$DATABASE;
is identical with
SELECT EXTRACT(WEEKDAY FROM
CURRENT_TIMESTAMP) + 1 FROM RDB$DATABASE;
Note:
The FreeAdhocUDF function F_DAYOFWEEK starts
(german) with sunday = 1 but EXTRACT(WEEKDAY ...) starts with
Sunday = 0. You can "repair" ist like shown above.
F_DAYOFYEAR could be replaced with EXTRACT(YEARDAY FROM ...)
SELECT F_DAYOFYEAR(CURRENT_TIMESTAMP)
FROM RDB$DATABASE;
is identical with
SELECT EXTRACT(YEARDAY FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
From
InterBase 7.5
CASE could replace F_IF
COLLESCE and
NULLIF could replace sqls to NULL and F_STRINGLENGTH(..) = 0 or ...
= 0
From
InterBase 2007
Some BLOb-functions now
obsolete, because InterBase2007 now handling
BLObs like "normal"strings
F_BLOBASPCHAR converting not longer necessary, you can write
sql directly with BLOBs
F_STRBLOB converting not longer necessary, you can write sql
directly with BLOBs
F_BLOB2EXCEL use STR2EXCEL
F_BLOBCAT use || (as in strings)
F_BLOBCATSTR use || (as in strings)
F_BLOBLEFT use F_LEFT
F_BLOBMID use F_MID
F_BLOBRIGHT use F_RIGHT
F_BLOBREPLACESTRING use F_REPLACESTRING
F_BLOBSUBSTR use F_SUBSTR
F_BLOBWORDCOUNT use F_WORDCOUNT
F_BLOBCOMPARE obsolete, you can compare BLOBs like strings
FireBird
From FireBird 1.0
F_YEAR could be
replaced with EXTRACT(YEAR FROM ...)
SELECT F_YEAR(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(YEAR FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_MONTH could be replaced with EXTRACT(MONTH FROM ...)
SELECT F_MONTH(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(MONTH FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_DAYOFMONTH could be replaced with EXTRACT(DAY FROM ...)
SELECT F_DAYOFMONTH(CURRENT_TIMESTAMP)
FROM RDB$DATABASE;
is identical with
SELECT EXTRACT(DAY FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_HOUR could be replaced with EXTRACT(HOUR FROM ...)
SELECT F_HOUR(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(HOUR FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_MINUTE could be replaced with EXTRACT(MINUTE FROM ...)
SELECT F_MINUTE(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(MINUTE FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_SECOND could be replaced with EXTRACT(SECOND FROM ...)
SELECT F_SECOND(CURRENT_TIMESTAMP) FROM
RDB$DATABASE;
is identical with
SELECT EXTRACT(SECOND FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_DAYOFWEEK could be replaced with EXTRACT(WEEKDAY FROM ...)
SELECT F_DAYOFWEEK(CURRENT_TIMESTAMP)
FROM RDB$DATABASE;
is identical with
SELECT EXTRACT(WEEKDAY FROM
CURRENT_TIMESTAMP) + 1 FROM RDB$DATABASE;
Note:
The FreeAdhocUDF function F_DAYOFWEEK starts
(german) with sunday = 1 but EXTRACT(WEEKDAY ...) starts with
Sunday = 0. You can "repair" ist like shown above.
F_DAYOFYEAR could be replaced with EXTRACT(YEARDAY FROM ...)
SELECT F_DAYOFYEAR(CURRENT_TIMESTAMP)
FROM RDB$DATABASE;
is identical with
SELECT EXTRACT(YEARDAY FROM
CURRENT_TIMESTAMP) FROM RDB$DATABASE;
F_MID could be replaced with SUBSTRING
SELECT 'cdefg' AS ISCORRECT,
F_MID('abcdefghijk', 2 ,5) FROM RDB$DATABASE
is identical with
SELECT 'cdefg' AS ISCORRECT,
SUBSTRING('abcdefghijk' FROM 3 FOR 5) FROM
RDB$DATABASE
From
FireBird
2.0
F_UPPER could be replaced with UPPER - also (german) umlaut
SELECT 'MÜLLER', F_UPPER('Müller') FROM
RDB$DATABASE;
is identical with
SELECT 'MÜLLER', UPPER('Müller') FROM
RDB$DATABASE;
F_LOWER could be replaced with LOWER - also (german) umlaut
SELECT 'müller', F_LOWER('MÜLLER') FROM
RDB$DATABASE;
is identical with
SELECT 'müller', LOWER('MÜLLER') FROM
RDB$DATABASE;
F_RTRIM could be replaced with TRIM
SELECT
F_RTRIM('abcde ') FROM RDB$DATABASE
is identical with
SELECT TRIM('abcde
') FROM RDB$DATABASE
F_IF could be replaced with IIF
SELECT F_IF(1, '>', 0, -1, 1)
FROM RDB$DATABASE;
is identical with
SELECT IIF(1 > 0, -1, 1) FROM
RDB$DATABASE;
F_STRINGLENGTH could be replaced with CHARACTER_LENGTH and
F_STRINGLENGTH could be replaced with CHAR_LENGTH
SELECT F_STRINGLENGTH('abcde') FROM
RDB$DATABASE;
is identical with
SELECT CHARACTER_LENGTH('abcde') FROM
RDB$DATABASE;
is identical with
SELECT CHAR_LENGTH('abcde') FROM
RDB$DATABASE
From FireBird
2.1
Some BLOb-functions now
obsolete, because FireBird 2.1 now handling
BLObs like "normal"strings
F_BLOBASPCHAR converting not longer necessary, you can write
sql directly with BLOBs
F_STRBLOB converting not longer necessary, you can write sql
directly with BLOBs
F_BLOB2EXCEL use STR2EXCEL
F_BLOBCAT use || (as in strings)
F_BLOBCATSTR use || (as in strings)
F_BLOBLEFT use F_LEFT or the build-in-function LEFT
F_BLOBMID use F_MID
F_BLOBRIGHT use F_RIGHT or the build-in-function RIGHT
F_BLOBREPLACESTRING use F_REPLACESTRING
F_BLOBSUBSTR use F_SUBSTR
F_BLOBWORDCOUNT use F_WORDCOUNT
F_BLOBCOMPARE obsolete, you can compare BLOBs like strings
build-in-functions
F_ABS (F_DOUBLEABS, F_INTEGERABS) use the build-in-function ABS
F_ACOS use the build-in-function ACOS
F_CHR (F_CHARACTER) use the build-in-function ASCII_CHAR
F_ORD use the build-in-function ASCII_VAL
F_ASIN use the build-in-function ASIN
F_ATAN use the build-in-function ATAN
F_ATAN2 use the build-in-function ATAN2
F_BIN_AND use the build-in-function BIN_AND
F_BIN_OR use the build-in-function BIN_OR
remark: BIN_NOT was forgotten ...
F_BIN_SHL use the build-in-function BIN_SHL
F_BIN_SHR use the build-in-function BIN_SHR
F_BIN_XOR use the build-in-function BIN_XOR
F_CEILING use the build-in-function CEIL | CEILING
F_COS use the build-in-function COS
F_COSH use the build-in-function COSH
F_COT use the build-in-function COT
F_ADDYEAR, F_ADDMONTH, F_ADDWEEK, F_ADDDAY, F_ADDHOUR, F_ADDMINUTE,
F_ADDSECOND
use the build-in-function DATEADD -
attention: totaly different syntax
F_AGEINYEARS,
F_AGEINMONTHS, F_AGEINWEEKS, F_AGEINDAYS, F_AGEINHOURS,
F_AGEINMINUTES,
F_AGEINSECONDS use the build-in-function DATEDIFF - bug, no testing
- attention: totaly different
syntax
F_IIF use the build-in-function DECODE - attention:
totaly different syntax
F_EXP use the build-in-function EXP
F_FLOOR use the build-in-function FLOOR
GEN_UUID creates a UUID but not
RFC4122
F_LEFT use the build-in-function LEFT
F_LN use the build-in-function LN
F_LOG use the build-in-function LOG - attention:
position of parameters changed
F_LOG10 use the build-in-function LOG10
F_LPAD use the build-in-function LPAD - attention:
if
the string to replace is longer than 1 character AND the
return-string is too long, LPAD cuts at the right site of the
string to
replace, F_PADLEFT on the left site
F_MAX (F_MAXNUM) use the build-in-function MAXVALUE
F_MIN (F_MINNUM) use the build-in-function MINVALUE
F_MODULO use the build-in-function MOD
F_STRSTUFF use the build-in-function OVERLAY - attention:
totaly different syntax
F_PI use the build-in-function PI
F_STRPOS use the build-in-function POSITION - attention:
totaly different syntax
F_POWER use the build-in-function POWER
F_RAND use the build-in-function RAND
F_REPLACE use the build-in-function REPLACE
F_REVERSE use the build-in-function REVERSE
F_RIGHT use the build-in-function RIGHT
F_ZAHLRUNDEN (F_ROUNDCOMMON) use the build-in-function ROUND - attention: the build-in-function ROUND
can also round the digits before the decimal point
F_RPADRIGHT (F_RIGHTPAD) use the build-in-function RPAD
F_SIGN use the build-in-function SIGN
F_SIN use the build-in-function SIN
F_SINH use the build-in-function SINH
F_SQRT use the build-in-function SQRT
F_TAN use the build-in-function TAN
F_TANH use the build-in-function TANH
F_TRUNCATE use the build-in-function
TRUNC |