F_STRCMP

<< F_EQUALSTRING | IBExpert UDF Functions | F_FINDWORD U_FINDWORD >>

F_STRCMP

 
  • input/output-compatibility to rFunc (STRCMP)

U_STRCMP

  • function from adhoc
  • Compatible with UTF-8
  • Input VARCHAR(8190) String 1, VARCHAR(8190) String 2
  • Output INTEGER output < 0 : string 1 smaller than string 2, output = 0 : string 1 equal to string 2, output > 0 : string 1 greater than string 2

Attention: in original rFunc-functions STRCMP the output positiv or negativ is different to the rFunc-BLOb-function B_STRCMP - in string-function a positiv output meens, that the first string is greater, in BLOb-function it meens, that the second BLOb is greater. For compatibility reasons do exactly the same.

Example

 SELECT 0 AS ISCORRECT, F_STRCMP('John like to drive fast', 'John like to drive fast') FROM RDB$DATABASE;

Expected results:

    ISCORRECT     F_STRCMP
 ============ ============
            0            0

Example

 SELECT 0 AS ISCORRECT, F_STRCMP('John like to drive fast', 'Joe like to drive fast') FROM RDB$DATABASE;

Expected results:

    ISCORRECT     F_STRCMP
 ============ ============
           73           73

Example

 SELECT -73 AS ISCORRECT, F_STRCMP('Joe like to drive fast', 'John like to drive fast') FROM RDB$DATABASE;

Expected results:

    ISCORRECT     F_STRCMP
 ============ ============
          -73          -73

Example

 SELECT NULL AS ISCORRECT, F_STRCMP(NULL, NULL) FROM RDB$DATABASE;

Expected results:

 ISCORRECT     F_STRCMP
 ========= ============
 <null>          <null>                 

back to top of page
<< F_EQUALSTRING | IBExpert UDF Functions | F_FINDWORD U_FINDWORD >>