meta data for this page
  •  

F_IF

function from adhoc

Entrypoint aif compatible with UTF-8


Inputs/Outputs

   Input     CSTRING(32)       Comparisonstring 1
             CSTRING(8)        Comparisonoperator
             CSTRING(32)       Comparisonstring 2
             CSTRING(8190)     if comparison applies, then result = Parameter 4
             CSTRING(8190)     if comparison does not apply, then result = Parameter 5
   Output    CSTRING(8190)     s.o.

Syntax

   "reproduction" of a IF-loop
   Comparisonoperator
           =
           <>
           <
           >
           <=
           >=
           Everyone of these operators a "n" (numeric) can be placed in front, if the two comparede strings contain floatingpoint, e.g. n =
   TestSQL
   SELECT 'Parameter 1 ist kleiner' AS ISCORRECT, F_IF('Test', '<=', 'Testa', 'Parameter 1 ist kleiner', 'Parameter 1 ist größer') FROM RDB$DATABASE;
   SELECT 'Parameter 1 ist größer' AS ISCORRECT, F_IF('Testb', '<=', 'Testa', 'Parameter 1 ist kleiner', 'Parameter 1 ist größer') FROM RDB$DATABASE;
   SELECT 'Parameter 1 ist kleiner' AS ISCORRECT, F_IF('Test1', 'n<=', 'Test2', 'Parameter 1 ist kleiner', 'Parameter 1 ist größer') FROM RDB$DATABASE;
   SELECT 'Parameter 1 ist kleiner' AS ISCORRECT, F_IF('123.45', 'n<=', '234.56', 'Parameter 1 ist kleiner', 'Parameter 1 ist größer') FROM RDB$DATABASE;
   SELECT NULL AS ISCORRECT, F_IF(NULL, NULL, NULL, NULL, NULL) FROM RDB$DATABASE;