DTRHELP.HLB  —  Functions  FN$DBKEY_LENGTH
       Returns the byte length of dbkeys for the relational domain or
       table specified as argument.

1  –  Input

       A string expression providing the name of the domain or table.
       The string expression must be placed inside quotation marks, and
       enclosed in parentheses.

2  –  Output

       The byte length of the dbkey. An error message is returned if the
       domain is unknown, or if the domain is not a relational one.

3  –  Example

       It is useful for example as an argument to the FN$STR_EXTRACT
       function, which extracts a substring from the input character
       string using a default edit string of 30 characters. In the
       following example FN$STR_EXTRACT extracts a substring from the
       100-character long field D. D is the variable, 1 is the starting
       character, and FN$DBKEY_LENGTH is the length of the desired
       substring:

       DTR> DECLARE D PIC X(100).;
       DTR> VAR = 1234567890
       DTR> PRINT FN$DBKEY_LENGTH("NULLS_1")

        FN$DBKEY
         LENGTH

                8

       DTR> PRINT FN$STR_EXTRACT (D,1,FN$DBKEY_LENGTH("NULLS_1"))

                  FN$STR
                  EXTRACT

       12345678

4  –  Usage Note

       This function has been implemented for Oracle Rdb dbkeys only.
Close Help