String-Functions:
Edit |
 |
from |
 |
substitutable
with
LEFT |
F_LEFT
(F_LEFT4, F_LEFT8)
F_BIGLEFT |
compatibility
to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
Entrypoint |
left |
not compatible with
UTF-8 - use U_LEFT(U_LEFT4, U_LEFT8) |
U_LEFT
(U_LEFT4, U_LEFT8)
|
function
from adhoc
|
Entrypoint |
u_left |
compatible
with
UTF-8 |
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; |
  |
from |
 |
substitutable
with SUBSTRING |
F_MID
(F_MID4, F_MID8)
F_BIGMID
|
compatibility
to FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP
|
Entrypoint |
mid |
not compatible with
UTF-8 - use U_MID(U_MID4, U_MID8) |
U_MID
(U_MID4, U_MID8)
|
function
from adhoc
|
Entrypoint |
u_mid |
compatible
with
UTF-8 |
F_COPY
|
compatibility
to GrUDF
|
Entrypoint |
mid1 |
not compatible with
UTF-8 - use U_MID(U_MID4, U_MID8) |
F_STRCOPY |
input/output-compatibility
to rFunc
(SUBSTR, LONGSUBSTR) |
Entrypoint |
strcopy |
not compatible with
UTF-8 - use U_MID(U_MID4, U_MID8) |
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 and
F_STRCOPY counting of parameter 2
start with
0, for F_COPY with 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; |
  |
from |
 |
substitutable
with
RIGHT |
F_RIGHT
(F_RIGHT4, F_RIGHT8)
F_BIGRIGHT |
compatibility
to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
Entrypoint |
right |
not compatible with
UTF-8 - use U_RIGHT(U_RIGHT4, U_RIGHT8) |
U_RIGHT
(U_RIGHT4, U_RIGHT8)
|
function
from adhoc
|
Entrypoint |
u_right |
compatible
with
UTF-8 |
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; |
  |
from |
 |
substitutable
with
POSITION |
F_SUBSTR
(F_SUBSTR4, F_SUBSTR8)
F_BIGSUBSTR
|
compatibility
to
FreeUDFLibC
|
Entrypoint |
substr |
not compatible with
UTF-8 - use U_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_STRSUB |
compatibility
to
FreeUDFLib,
FreeUDFLib AvERP, GrUDF |
Entrypoint |
strsub |
not compatible with
UTF-8 - use U_SUBSTR |
F_STRPOS |
input/output-compatibility to rFunc
(STRPOS) |
Entrypoint |
strpos |
not compatible with
UTF-8 - use U_SUBSTR |
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 |
not compatible with
UTF-8 - use U_SUBSTR |
U_SUBSTR |
function
from adhoc |
Entrypoint |
u_substr |
compatible
with
UTF-8 |
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 |
function
from adhoc |
Entrypoint |
strsubn |
not compatible with
UTF-8 - use U_SUBSTR |
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 |
not compatible with
UTF-8 - use U_STRRM |
U_STRRM
|
function
from
adhoc |
Entrypoint |
u_strrm |
compatible
with
UTF-8 |
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 |
compatible with
UTF-8 |
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; |
  |
from |
 |
substitutable
with
TRIM |
F_RTRIM
(F_RTRIM4, F_RTRIM8)
F_BIGRTRIM |
compatibility
to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc
(
RTRIM, LONGRTRIM) |
Entrypoint |
rtrim |
compatible with
UTF-8 |
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 |
compatible
with
UTF-8 |
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; |
  |
from |
 |
substitutable
with
LPAD |
F_PADLEFT |
compatibility
to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
Entrypoint |
padleft |
not compatible with
UTF-8 - use U_PADLEFT |
U_PADLEFT |
function
from adhoc
|
Entrypoint |
u_padleft |
compatible
with
UTF-8 |
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) |
Entrypoint |
r_padleft |
not compatible with
UTF-8 - use U_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; |
  |
from |
 |
substitutable
with
RPAD |
F_PADRIGHT |
compatibility
to
FreeUDFLib,
FreeUDFLibC, FreeUDFLib AvERP, GrUDF |
Entrypoint |
padright |
not compatible with
UTF-8 - use U_PADRIGHT |
U_PADRIGHT |
function
from adhoc
|
Entrypoint |
u_padright |
compatible
with
UTF-8 |
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) |
Entrypoint |
r_padright |
not compatible with
UTF-8 - use U_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 |
not compatible with
UTF-8 - use U_PADCENTER |
U_PADCENTER |
function
from adhoc
|
Entrypoint |
u_padcenter |
compatible
with
UTF-8 |
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 |
not compatible with
UTF-8 - use U_LINEWRAP |
U_LINEWRAP |
function
from adhoc
|
Entrypoint |
u_linewrap |
compatible
with
UTF-8 |
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; |
  |
from |
 |
substitutable
with
REPLACE |
F_REPLACE
(F_REPLACE4, ...8)
F_BIGREPLACE |
compatibility
to
FreeUDFLibC |
Entrypoint |
replace |
compatible with
UTF-8 |
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 |
not compatible with
UTF-8 - use U_REPLACESTRING |
U_REPLACESTRING
(..4, ..8)
|
function
from adhoc
|
Entrypoint |
u_replacestring |
compatible
with
UTF-8 |
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 |
not compatible with
UTF-8 - use U_CONVERTSYMBOL |
U_CONVERTSYMBOLS |
function
from adhoc
|
Entrypoint |
u_convertsymbols |
compatible
with
UTF-8 |
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; |
  |
from |
 |
substitutable
with
REVERSE |
F_REVERSE |
function
from adhoc
|
Entrypoint |
reverse |
not compatible with
UTF-8 - use U_REVERSE |
U_REVERSE |
function
from adhoc
|
Entrypoint |
u_reverse |
compatible
with
UTF-8 |
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 |
not compatible with
UTF-8 - use U_STRIPSTRING |
F_STRIPSTRING |
function
from adhoc |
Entrypoint |
u_stripstring |
compatible
with
UTF-8 |
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 |
not compatible with
UTF-8 - use U_STRIPSTRINGHOLD |
U_STRIPSTRINGHOLD
|
function
from adhoc |
Entrypoint |
u_stripstringhold |
compatible
with
UTF-8 |
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 |
not compatible with
UTF-8 - use U_REPEATTRIM |
U_REPEATTRIM |
|
Entrypoint
|
u_repeattrim |
compatible
with
UTF-8 |
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 |
compatible
with
UTF-8 |
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_STROFCHAR |
compatibility
to
GrUDF |
Entrypoint |
strofchar |
not compatible with
UTF-8 - use F_STRREPEAT |
Input |
CSTRING(1)
INTEGER |
String
to repeat
Number of repetitions |
Output |
CSTRING(32760) |
Returns
a string with the
indicated number of
repeated indications |
TestSQL
SELECT F_STRINGLENGTH(F_STROFCHAR('A', 10)) || ' mal A' AS
ISCORRECT,
F_STROFCHAR('A', 10) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_STROFCHAR(NULL, NULL) FROM RDB$DATABASE; |
  |
from |
 |
substitutable
with
OVERLAY |
F_STRSTUFF |
input/output-compatibility
to rFunc
(STRSTUFF, LONGSTRSTUFF)
|
Entrypoint
|
strstuff |
not compatible with
UTF-8 - use U_STRSTUFF |
U_STRSTUFF |
function
from adhoc |
Entrypoint
|
u_strstuff |
compatible
with
UTF-8 |
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 |
not compatible with
UTF-8 - if needed please ask |
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 |
not compatible with
UTF-8 - if needed please ask |
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 |
not compatible with
UTF-8 - use U_PRED |
U_PRED
|
function
from adhoc
|
Entrypoint |
u_predecessor |
compatible
with
UTF-8 |
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 'a' AS ISCORRECT, F_PRED('b', 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;
SELECT '¢' AS ISCORRECT, U_PRED('£', 1) FROM
RDB$DATABASE;
SELECT '¡' AS ISCORRECT, U_PRED('£', 2) FROM
RDB$DATABASE;
SELECT 'あ' AS ISCORRECT, U_PRED('え', 6) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_PRED(NULL, NULL) FROM RDB$DATABASE; |
  |
F_SUCC |
function
from adhoc
|
Entrypoint |
successor |
not compatible with
UTF-8 - use U_SUCC |
U_SUCC |
function
from adhoc
|
Entrypoint |
u_successor |
compatible
with
UTF-8 |
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;
SELECT '¤' AS ISCORRECT, U_SUCC('£', 1) FROM
RDB$DATABASE;
SELECT '×' AS ISCORRECT, U_SUCC('Ö', 1) FROM
RDB$DATABASE;
SELECT 'Γ' AS ISCORRECT, U_SUCC('Ώ', 4) FROM RDB$DATABASE;
SELECT 'ぎ' AS ISCORRECT, U_SUCC('え', 6) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, U_SUCC(NULL, NULL) FROM RDB$DATABASE;
|
  |