F_

<< F_RIGHT (F_RIGHT4, F_RIGHT8) F_BIGRIGHT U_RIGHT(U_RIGHT4, U_RIGHT8) | IBExpert UDF Functions | F_SUBSTRN (F_SUBSTR) U_SUBSTR F_STRSUBN >>

F_SUBSTR (F_SUBSTR4, F_SUBSTR8) F_BIGSUBSTR

 
substitutable with POSITION also use U_SUBSTR
  • compatibility to FreeUDFLibC
  • Compatible with UTF-8
  • Input VARCHAR(8190) String 1 (in which the position of parameter 2 is to be determined), VARCHAR(1024) String 2 (to be determined)
  • Output INTEGER first position in string 1 where string 2 starts

F_STRSUB

  • compatibility to FreeUDFLib, FreeUDFLib AvERP, GrUDF

F_STRPOS also use U_SUBSTR

  • input/output-compatibility to rFunc (STRPOS)
  • Input VARCHAR(1024) String 1 (to be determined) VARCHAR(8190) String 2 (in which the position of parameter 2 is to be determined),
  • 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.

Example

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

Expected results:

   ISCORRECT     F_SUBSTR
 ============ ============
          13           13

Example

 SELECT -1 AS ISCORRECT, F_SUBSTR('John like to drive fast', 'dive') FROM RDB$DATABASE;

Expected results:

   ISCORRECT     F_SUBSTR
 ============ ============
          -1           -1

Example

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

Expected results:

   ISCORRECT     F_SUBSTR
 ============ ============
   <null>          <null>

Example

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

Expected results:

   ISCORRECT     F_SUBSTR
 ============ ============
          14           14

Example

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

Expected results:

   ISCORRECT     F_SUBSTR
 ============ ============
          0           0

back to top of page
<< F_RIGHT (F_RIGHT4, F_RIGHT8) F_BIGRIGHT U_RIGHT(U_RIGHT4, U_RIGHT8) | IBExpert UDF Functions | F_SUBSTRN (F_SUBSTR) U_SUBSTR F_STRSUBN >>