String-Functions:
Edit |
 |
F_LEFT
(F_LEFT4, F_LEFT8)
F_BIGLEFT |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
|
 |
substitutable
with LEFT |
Entrypoint |
left |
|
Input |
CSTRING(254)
INTEGER |
string
length of the cut-off-string |
Output |
CSTRING(254) |
string cut on the number
indication from left
gives from parameter 2 |
Counting
starts with 1
TestSQL
SELECT 'Dies i' AS ISCORRECT, F_LEFT('Dies ist ein Test', 6) FROM
RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LEFT(NULL, NULL) FROM RDB$DATABASE; |
  |
F_MID
(F_MID4, F_MID8)
F_BIGMID |
compatibility to FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP
input/output-compatibility to IB_UDF
|
|
 |
substitutable
with SUBSTRING |
Entrypoint |
mid |
|
F_COPY
F_STRCOPY |
compatibility
to GrUDF
input/output-compatibility to rFunc
(SUBSTR, LONGSUBSTR) |
Entrypoint |
mid1 |
|
Input |
CSTRING(254)
INTEGER
INTEGER |
String, from which a
character string is to be determined
Startposition of the string
Length of the string |
Output |
CSTRING(254) |
string starts at position
form parameter 2 with
the lenght of parameter 3
|
For F_MID counting of parameter 2 start with
0, for F_COPY and F_STRCOPY at 1!
TestSQL
SELECT 'tag' AS ISCORRECT, F_MID('Geburtstagsparty', 7, 3)
FROM RDB$DATABASE;
SELECT 'tag' AS ISCORRECT, F_COPY('Geburtstagsparty', 8, 3)
FROM RDB$DATABASE;
SELECT 'tag' AS ISCORRECT, F_STRCOPY('Geburtstagsparty', 7,
3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MID(NULL, NULL, NULL) FROM RDB$DATABASE; |
  |
F_RIGHT
(F_RIGHT4, F_RIGHT8)
F_BIGRIGHT |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
|
 |
substitutable
with
RIGHT |
Entrypoint |
right |
|
Input |
CSTRING(254)
INTEGER |
String
length of the cut-off-string |
Output |
CSTRING(254) |
string cut on the number
indication from right
gives from parameter 2 |
Counting
starts with 1
TestSQL
SELECT 'n Test' AS ISCORRECT, F_RIGHT('Dies ist ein Test', 6) FROM
RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_RIGHT(NULL, NULL) FROM RDB$DATABASE; |
  |
F_SUBSTR
(F_SUBSTR4, F_SUBSTR8)
F_BIGSUBSTR
|
compatibility to
FreeUDFLibC
compatibility
to
FreeUDFLibC
|
Entrypoint |
substr |
|
Input |
CSTRING(8190)
CSTRING(1024) |
String 1 (in which the
position of parameter 2
is to be determin)
String 2 (to be determin) |
Output |
INTEGER |
first position
in string 1 where
string 2 starts |
F_SUBSTR
(F_STRSUB) |
compatibility
to
FreeUDFLib,
FreeUDFLib AvERP, GrUDF |
Entrypoint |
strsub |
|
F_STRPOS |
input/output-compatibility to rFunc
(STRPOS) |
|
 |
substitutable
with
POSITION |
Entrypoint |
strpos |
|
Input |
CSTRING(1024)
CSTRING(8190) |
String 1 (to be determin)
String 2 (in which the position of parameter 2 is to be determin)
|
Output |
INTEGER |
first position
in string 1 where
string 2 starts |
F_SUBSTR,
F_STRSUB etc.: Counting starts with 0, if not found -1.
F_STRPOS: Counting
starts with 1, if not found 0.
Notice:
In the original FreeUDFLib (1998 by Gregory Deatz) the order of the
input-parameters are swapped to the other string-funktions and to the
c-version (1999 by Gregory Deatz) of the FreeUDFLibC. To maintain
backward compatibility for both versions there are two different
“entrypoints” you can use in the DECLARE-Script of F_SUBSTR.
- To be compatible with the (Delphi-)FreeUDFLib, the FreeUDFLib AvERP
and the GrUDF (which is compatible to the Delphi-FreeUDFLib) use the
entrypoint “strsub”
- for compatibility to FreeUDFLibC use entrypoint “substr”.
TestSQL (Version FreeUDFLibC mit Entrypoint substr)
SELECT 9 AS ISCORRECT, F_SUBSTR('Pauline fährt in Urlaub', 'ähr') FROM
RDB$DATABASE;
SELECT -1 AS ISCORRECT, F_SUBSTR('Pauline fährt in Urlaub', 'chr') FROM
RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SUBSTR(NULL, NULL) FROM RDB$DATABASE;
SELECT
10 AS ISCORRECT, F_STRPOS('ähr', 'Pauline fährt in Urlaub') FROM
RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_STRPOS('chr', 'Pauline
fährt in Urlaub') FROM RDB$DATABASE;
TestSQL (Version FreeUDFLib, GrUDF mit Entrypoint strsub)
SELECT 9 AS ISCORRECT, F_SUBSTR('ähr', 'Pauline fährt in Urlaub') FROM
RDB$DATABASE; |
  |
F_SUBSTRN
(F_SUBSTR)  |
function
from adhoc |
Entrypoint |
substrn |
|
Input |
CSTRING(8190)
CSTRING(1024) |
String 1 (in which the
position of parameter 2
is to be determin)
String 2 (to be determin) |
Output |
INTEGER |
first position in string 1
where string 2 starts |
F_STRSUBN
(F_SUBSTR)  |
function
from adhoc |
Entrypoint |
strsubn |
|
Input |
CSTRING(1024)
CSTRING(8190) |
String 1 (to be determin)
String 2 (in which the position of parameter 2 is to be determin) |
Output |
INTEGER |
first position in string 2
where string 1 starts |
The
formerly functions (F_SUBSTR and
F_STRSUB) return -1 if the string is not found. To get a correct
<null> in FireBird 2.0 (and to save the old variant with
-1) use
the entrypoint "strsubnull" or "substrnull".
TestSQL (Version FreeUDFLibC mit Entrypoint substrnull)
SELECT NULL AS ISCORRECT, F_SUBSTR('Pauline fährt in Urlaub', 'chr')
FROM
RDB$DATABASE; |
  |
F_STRRM
|
compatibility to
|
Entrypoint |
strrm |
|
Input |
CSTRING(8190)
INTEGER |
String where a character
string had to be remove
Place in the string, which is to be removed |
Output |
CSTRING(8190) |
string with the removed
string |
counting starts with 0
TestSQL
SELECT 'ies ist ein Test' AS ISCORRECT, F_STRRM('Dies ist ein Test', 0)
FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRRM(NULL, NULL) FROM RDB$DATABASE; |
  |
F_LTRIM
(F_LTRIM4, F_LTRIM8)
F_BIGLTRIM |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (
LTRIM, LONGLTRIM) |
Entrypoint |
ltrim |
|
Input |
CSTRING(8190) |
String whose leeding blanks
should be
removed |
Output |
CSTRING(8190) |
String without leeding
blanks |
Does not
remove the protected blanks (with < ALT > < 255
>)
TestSQL
SELECT 'Dies ist ein Test' AS ISCORRECT, F_LTRIM('
Dies ist ein Test') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LTRIM(NULL) FROM RDB$DATABASE; |
  |
F_RTRIM
(F_RTRIM4, F_RTRIM8)
F_BIGRTRIM |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (
RTRIM, LONGRTRIM) |
|
 |
substitutable
with
TRIM |
Entrypoint |
rtrim |
|
Input |
CSTRING(8190) |
String whose trailing
blanks should be
removed |
Output |
CSTRING(8190) |
String without trailing
blanks |
Does not
remove the protected blanks (with < ALT > < 255
>)
TestSQL
SELECT 'Dies ist ein Test' AS ISCORRECT, F_STRINGLENGTH(F_RTRIM('Dies
ist ein Test ')) AS ANZ_ZEICHEN, F_RTRIM('Dies ist
ein
Test ') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRINGLENGTH(F_RTRIM(NULL)) AS ANZ_ZEICHEN,
F_RTRIM(NULL) FROM RDB$DATABASE; |
  |
F_LRTRIM
(F_LRTRIM4, F_LRTRIM8)
F_BIGLRTRIM |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc
(TRIM, LONGTRIM) |
Entrypoint |
lrtrim |
|
Input |
CSTRING(8190) |
String whose leeding and
trailing blanks should
be removed |
Output |
CSTRING(8190) |
String without leeding and
trailing blanks |
Does not
remove the
protected blanks (with < ALT > < 255 >)
TestSQL
SELECT 'Dies ist ein Test' AS ISCORRECT,
F_STRINGLENGTH(F_LRTRIM(' Dies ist ein
Test ')) AS
ANZ_ZEICHEN, F_LRTRIM(' Dies ist ein Test
') FROM
RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRINGLENGTH(F_LRTRIM(NULL)) AS
ANZ_ZEICHEN, F_LRTRIM(NULL) FROM RDB$DATABASE; |
  |
F_PADLEFT |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
|
 |
substitutable
with
LPAD |
Entrypoint |
padleft |
|
Input |
CSTRING(4095)
CSTRING(16)
INTEGER |
String 1, filled up left
with the indications from string 2 to the length of parameter 3
String 2 to fill up with
Length of the string, up to which is to be filled up |
Output |
CSTRING(4095) |
String 1 left filled up
from the string with
the indications from string 2 to the overall length of indications of
parameter 3 |
F_RPADLEFT |
input/output-compatibility to rFunc
(PADLEFT, LONGPADLEFT) |
|
 |
substitutable
with
LPAD |
Entrypoint |
r_padleft |
|
Input |
CSTRING(4095)
INTEGER
CSTRING(16)
|
String 1, filled up left
with the indications
from string 2 to the length of parameter 3
Length of the
string, up to which is to be filled up
String 2 to fill up with |
Output |
CSTRING(4095) |
String 1 left filled up
from the string with
the indications from string 2 to the overall length of indications of
parameter 3 |
If you
enter more than one character in string 2, the filling with characters
of string 2 starts from right and abort, if the required number of the
complete characters will be reached. (Look at. 2. TestSQL)
TestSQL
SELECT 'XXXDies ist ein Test' AS ISCORRECT, F_PADLEFT('Dies ist ein
Test', 'X', 20) FROM RDB$DATABASE;
SELECT 'xXxDies ist ein Test' AS ISCORRECT, F_PADLEFT('Dies ist ein
Test', 'Xx', 20) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PADLEFT(NULL, NULL, NULL) FROM RDB$DATABASE; |
  |
F_PADRIGHT |
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
|
 |
substitutable
with
RPAD |
Entrypoint |
padright |
|
Input |
CSTRING(4095)
CSTRING(16)
INTEGER |
String 1, filled up right
with the indications
from string 2 to the length of parameter 3
String 2 to fill up with
Length of the string, up to which is to be filled up |
Output |
CSTRING(4095) |
String 1 right filled up
from the string with
the indications from string 2 to the overall length of indications of
parameter 3 |
F_RPADRIGHT |
input/output-compatibility to rFunc
(PADRIGHT, LONGPADRIGHT) |
|
 |
substitutable
with
RPAD |
Entrypoint |
r_padright |
|
Input |
CSTRING(4095)
INTEGER
CSTRING(16) |
String 1, filled up right
with the indications
from string 2 to the length of parameter 3
Length of the
string, up to which is to be filled up
String 2 to fill up with |
Output |
CSTRING(4095) |
|
If
you
enter more than one character in string 2, the filling with characters
of string 2 starts from right and abort, if the required number of the
complete characters will be reached. (Look at. 2. TestSQL)
TestSQL
SELECT 'Dies ist ein TestXXX' AS ISCORRECT, F_PADRIGHT('Dies ist ein
Test', 'X', 20) FROM RDB$DATABASE;
SELECT 'Dies ist ein TestXxX' AS ISCORRECT, F_PADRIGHT('Dies ist ein
Test', 'Xx', 20) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PADRIGHT(NULL, NULL, NULL) FROM
RDB$DATABASE; |
  |
F_PADCENTER |
function
from adhoc
|
Entrypoint |
padcenter |
|
Input |
CSTRING(4095)
CSTRING(16)
INTEGER |
String 1, filled up with
the indications from string 2 to the length of parameter 3
String 2 to fill up with
Length of the string, up to which is to be filled up |
Output |
CSTRING(4095) |
String 1 left and right
filled
up from the string with the indications from string 2 to the overall
length of indications of parameter 3 |
If the "filled-length" is not eval, there is
one more character filled up left
TestSQL
SELECT 'XXDies ist ein TestXX' AS ISCORRECT, F_PADCENTER('Dies ist ein
Test', 'X', 21) FROM RDB$DATABASE;
SELECT 'XXDies ist ein TestX' AS ISCORRECT, F_PADCENTER('Dies ist ein
Test', 'X', 20) FROM RDB$DATABASE;
SELECT 'XxDies ist ein TestXx' AS ISCORRECT, F_PADCENTER('Dies ist ein
Test', 'Xx', 21) FROM RDB$DATABASE;
SELECT 'XxDies ist ein TestX' AS ISCORRECT, F_PADCENTER('Dies ist ein
Test', 'Xx', 20) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PADCENTER(NULL, NULL, NULL) FROM
RDB$DATABASE; |
  |
F_LINEWRAP
|
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
Entrypoint |
linewrap |
|
Input |
CSTRING(32760)
INTEGER
INTEGER |
String
starting position
measure |
Output |
CSTRING(32760) |
Spends all words of the
string, begin with the
initial position, which are all not longer than the measure. |
Counting starts with 0.
TestSQL
SELECT 'alle einer Geburtstagsparty' AS ISCORRECT,
F_LINEWRAP('Wir gehen alle einer Geburtstagsparty', 10, 30) FROM
RDB$DATABASE;
SELECT 'alle einer' AS ISCORRECT, F_LINEWRAP('Wir gehen
alle einer Geburtstagsparty', 10, 29) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LINEWRAP(NULL, NULL, NULL) FROM
RDB$DATABASE; |
  |
F_REPLACE
(F_REPLACE4, ...8)
F_BIGREPLACE |
compatibility to
FreeUDFLibC |
|
 |
substitutable
with
REPLACE |
Entrypoint |
replace |
|
Input |
CSTRING(32760)
CSTRING(254)
CSTRING(254) |
string where a character
string had to be
exchanged
old string
new string |
Output |
CSTRING(32760) |
string with
replaced characters from
parameter 2 with characters from parameter 3 |
Easy
version of the funktion F_REPLACESTRING without the posibility
to
change the string more than one time and independent of upper and lower
case.
TestSQL
SELECT 'Dies ist ein Versuch zwei Versuch drei Versuch vier TEST' AS
ISCORRECT, F_REPLACE('Dies ist ein Test zwei Test drei Test vier TEST',
'Test', 'Versuch') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_REPLACE(NULL, NULL, NULL) FROM RDB$DATABASE; |
  |
F_REPLACESTRING
(..4, ..8)
F_BIGREPLACESTRING |
compatibility to
FreeUDFLib AvERP, GrUDF |
Entrypoint |
replacestring |
|
Input |
CSTRING(32760)
CSTRING(254)
CSTRING(254)
INTEGER
INTEGER |
string where a character
string had to be exchanged
old string
new string
0 = replace only the first occurrence, 1 = replace all
occurrences
0 = consider upper and lower case, 1 = not consider |
Output |
CSTRING(32760) |
string with
replaced characters from
parameter 2 with characters from parameter 3 |
TestSQL
SELECT 'Dies ist ein Versuch zwei Test drei Test vier TEST' AS
ISCORRECT, F_REPLACESTRING('Dies ist ein Test zwei Test drei Test vier
TEST', 'Test', 'Versuch', 0, 0) FROM RDB$DATABASE;
SELECT 'Dies ist ein Versuch zwei Test drei Test vier TEST' AS
ISCORRECT, F_REPLACESTRING('Dies ist ein Test zwei Test drei Test vier
TEST', 'Test', 'Versuch', 0, 1) FROM RDB$DATABASE;
SELECT 'Dies ist ein Versuch zwei Versuch drei Versuch vier TEST' AS
ISCORRECT, F_REPLACESTRING('Dies ist ein Test zwei Test drei Test vier
TEST', 'Test', 'Versuch', 1, 0) FROM RDB$DATABASE;
SELECT 'Dies ist ein Versuch zwei Versuch drei Versuch vier Versuch' AS
ISCORRECT, F_REPLACESTRING('Dies ist ein Test zwei Test drei Test vier
TEST', 'Test', 'Versuch', 1, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_REPLACESTRING(NULL, NULL, NULL, NULL, NULL)
FROM RDB$DATABASE; |
  |
F_CONVERTSYMBOLS |
input/output-compatibility to rFunc
(CONVERTSYMBOLS, LONGCONVERTSYMBOLS) |
Entrypoint |
convertsymbols |
|
Input |
CSTRING(32760)
CSTRING(254)
CSTRING(254) |
String in which
characters should be
replaced
String 2 with all characters to be replaced
String
3 with characters to replace
with characters at the same place in string 2 |
Output |
CSTRING(32760) |
String in which
all characters
where replaced with characters from string 3 |
TestSQL
SELECT
'(a+ab)-abc*a+b=c' AS ISCORRECT, F_CONVERTSYMBOLS('(1+12)-123*1+2=3',
'123', 'abc') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_CONVERTSYMBOLS(NULL, NULL, NULL)
FROM RDB$DATABASE; |
  |
F_REVERSE |
function
from adhoc
|
|
 |
substitutable
with
REVERSE |
Entrypoint |
reverse |
|
Input |
CSTRING(254) |
string to return backwards |
Output |
CSTRING(254) |
string backwards |
Upper-/lower-case stays as in the original
string.
TestSQL
SELECT 'ynamreG' AS ISCORRECT, F_REVERSE('Germany') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_REVERSE(NULL) FROM RDB$DATABASE; |
  |
F_STRIPSTRING
F_BIGSTRIPSTRING
|
compatibility to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
Entrypoint |
stripstring |
|
Input |
CSTRING(32760)
CSTRING(254) |
String 1
String 2 as a list of all characters which are to delete |
Output |
CSTRING(32760) |
String stripped
from all characters
which are content of parameter 2
|
Counterpart to F_STRIPSTRINGHOLD and
F_HOLDSTRING
TestSQL
SELECT 'Ds s n Ts Tx' AS ISCORRECT, F_STRIPSTRING('Dies ist ein Test
Text', 'iet') FROM RDB$DATABASE;
SELECT 'Ds s n Ts Tx' AS ISCORRECT, F_STRIPSTRING('Dies ist ein Test
Text', 'tei') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRIPSTRING(NULL, NULL) FROM RDB$DATABASE; |
  |
F_STRIPSTRINGHOLD
F_HOLDSTRING
F_BIGSTRIPSTRINGHOLD |
compatibility to
FreeUDFLib,
FreeUDFLib AvERP, GrUDF
compatibility
to FreeUDFLibC
|
Entrypoint |
stripstringhold |
|
Input |
CSTRING(32760)
CSTRING(254) |
String 1
String 2 as a list of all characters which are not to delete
|
Output |
CSTRING(32760) |
String stripped from all
characters which are not
content of
parameter 2
|
The
sequence of the indications in the string 2 does not matter.
Counterpart to F_STRIPSTRING
Note:
In a SQL F_HOLDSTRING and F_STRIPSTRINGHOLD may not use at the same
time.
TestSQL
SELECT 'ieiteietet' AS ISCORRECT, F_HOLDSTRING('Dies ist ein Test
Text', 'iet') FROM RDB$DATABASE;
SELECT 'ieiteietet' AS ISCORRECT, F_HOLDSTRING('Dies ist ein Test
Text', 'tei') FROM RDB$DATABASE;
SELECT 'ieiteietet' AS ISCORRECT, F_HOLDSTRING('Dies ist ein Test
Text', 'iet') FROM RDB$DATABASE;
SELECT 'ieiteietet' AS ISCORRECT, F_HOLDSTRING('Dies ist ein Test
Text', 'tei') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRIPSTRINGHOLD(NULL, NULL) FROM
RDB$DATABASE; |
  |
F_REPEATTRIM |
input/output-compatibility to rFunc
(REPEATTRIM, LONGREPEATTRIM)
|
Entrypoint
|
repeattrim |
|
Input |
CSTRING(8190)
CSTRING(1) |
String
1 from which characters will be removed
character to remove |
Output |
CSTRING(8190) |
String with removed all
repeatings of
characters parameter 2 |
TestSQL
SELECT '123' AS ISCORRECT, F_REPEATTRIM('12223', '2') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_REPEATTRIM(NULL, NULL) FROM RDB$DATABASE;
|
  |
F_STRREPEAT |
input/output-compatibility to rFunc
(STRREPEAT, LONGSTRREPEAT)
|
Entrypoint
|
strrepeat |
|
Input |
CSTRING(254)
SMALLINT |
String to repeat
count of
appearance
|
Output |
CSTRING(8190) |
String 1 with parameter 2
times appearances
|
You have
to look that the output is not greater than the declaration!
TestSQL
SELECT 'TestTestTest' AS ISCORRECT, F_STRREPEAT('Test', 3) FROM
RDB$DATABASE;
SELECT '' AS ISCORRECT, F_STRREPEAT('Test', 0)
FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STRREPEAT(NULL,
NULL) FROM
RDB$DATABASE; |
  |
F_STRSTUFF |
input/output-compatibility to rFunc
(STRSTUFF, LONGSTRSTUFF)
|
|
 |
substitutable
with
OVERLAY |
Entrypoint
|
strstuff |
|
Input |
CSTRING(8190)
SMALLINT
SMALLINT
CSTRING(254) |
String
1 in which characters had to replace
starting-position
number
of characters to delete
characters to set |
Output |
CSTRING(81900) |
String with replaced
characters at
starting-postion |
Counting oof starting-position starts at 1.
The
numbers of characters to delete and characters to replace must not be
equal.
TestSQL
SELECT '12abcd567890' AS ISCORRECT,
F_STRSTUFF('1234567890', 3, 2, 'abcd') FROM RDB$DATABASE;
SELECT
NULL AS ISCORRECT, F_STRSTUFF(NULL, NULL, NULL, NULL) FROM
RDB$DATABASE; |
  |
F_COLLATEBR |
compatibility to
GrUDF |
Entrypoint |
collatebr |
|
Input |
CSTRING(32760) |
String in
which special characters are
to be converted |
Output |
CSTRING(32760) |
changed String |
Changes intended "umlauts" for given indications
á, â, ã, à, ä, å, Á, Â, Ã, À, Ä, Å
=> A
é, ê, è, ë, É, Ê, È, Ë
=> E
í, î, ì, ï, Í, Î, Ì, Ï
=> I
ó, ô, õ, ò, ö, Ó, Ô, Õ, Ò, Ö
=> O
ú, û, ù, ü,Ú, Û, Ù, Ü
=> U
ç, Ç
=> C
ñ, Ñ
=> N
ý, ÿ, Ý
=> Y
Note:
TestSQL
SELECT 'AAAAAAAAAAAA' AS ISCORRECT, F_COLLATEBR('áâãàäåÁÂÃÀÄÅ')
FROM RDB$DATABASE;
SELECT 'EEEEEEEE' AS ISCORRECT, F_COLLATEBR('éêèëÉÊÈË') FROM
RDB$DATABASE;
SELECT 'IIIIIIII' AS ISCORRECT, F_COLLATEBR('íîìïÍÎÌÏ') FROM
RDB$DATABASE;
SELECT 'OOOOOOOOOO' AS ISCORRECT, F_COLLATEBR('óôõòöÓÔÕÒÖ') FROM
RDB$DATABASE;
SELECT 'UUUUUUUU' AS ISCORRECT, F_COLLATEBR('úûùüÚÛÙÜ') FROM
RDB$DATABASE;
SELECT 'CC' AS ISCORRECT, F_COLLATEBR('çÇ') FROM RDB$DATABASE;
SELECT 'NN' AS ISCORRECT, F_COLLATEBR('ñÑ') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_COLLATEBR(NULL) FROM RDB$DATABASE; |
  |
F_KEYUP |
function
from adhoc |
Entrypoint
|
keyup |
|
Input |
CSTRING(32760)
SMALLINT |
String to prepaired
length of
output-string |
Output |
CSTRING(32760) |
prepaired string |
Prepaires a string with
- all to upper
-
uses only alphanumeric characters incl. umlaut
- changes
intended "umlauts" for given indications
Á, Â, Ã, À, Ä, Å
=> A
É, Ê, È, Ë
=> E
Í, Î, Ì, Ï
=> I
Ó, Ô, Õ, Ò, Ö
=> O
Ú, Û, Ù, Ü
=> U
Ç
=> C
Æ
=> AE
Ø
=> OE
ß
=> SS
Đ
=> D
Ñ
=> N
Ý
=> Y
- truncate string to given length
TestSQL
SELECT
'7A 5E 5I 6O 5U 2C 2AE 2OE 4S 2D 2N 2Y 1234567' AS ISCORRECT,
F_KEYUP('AáâãàäåEéêèëIíîìïOóôõòöUúûùüCçAEæOEøSSßDd.NñYý1234567890', 55)
FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_KEYUP(NULL,
NULL) FROM RDB$DATABASE; |
  |
F_PRED
|
function
from adhoc
|
Entrypoint |
predecessor |
|
Input |
CSTRING(1)
INTEGER |
Character
Amount of characters before the character in ASCII-Table
|
Output |
CSTRING(1) |
n-predecessor of character
from parameter 1 |
Is parameter 2 equal to 512
(or multiple of 512) the return is the same as the input.
Test SQL
SELECT 'b' AS ISCORRECT, F_PRED('a', 1) FROM RDB$DATABASE;
SELECT 'b' AS ISCORRECT, F_PRED('c', -1) FROM RDB$DATABASE;
SELECT 'a' AS ISCORRECT, F_PRED('a', 512) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_PRED(NULL, NULL) FROM RDB$DATABASE; |
  |
F_SUCC |
function
from adhoc
|
Entrypoint |
successor |
|
Input |
CSTRING(1)
INTEGER |
Character
Amount of characters behind the character in ASCII-Table |
Output |
CSTRING(1) |
n-successor of character
from parameter 1 |
Is parameter 2 equal to 512
(or multiple of 512) the return is the same as the input.
Test SQL
SELECT 'a' AS ISCORRECT, F_SUCC('b', 1) FROM RDB$DATABASE;
SELECT 'c' AS ISCORRECT, F_SUCC('b', -1) FROM RDB$DATABASE;
SELECT 'b' AS ISCORRECT, F_SUCC('b', 512) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SUCC(NULL, NULL) FROM RDB$DATABASE; |
  |