How to: |
The SUBSTR function returns a substring of a character value. You specify the start position of the substring within the value. You can also specify the length of the substring (if omitted, the substring extends from the start position to the end of the string value). If the specified length value is longer than the input string, the result is the full input string.
SUBSTRING is identical to SUBSTR.
SUBSTR(arg FROM start-pos [FOR length])
or
SUBSTR(arg, start-pos [, length])
where:
character string
Is the field containing the parent character string.
Integer
Is the position within arg at which the substring begins.
Integer
If present, is the length of the substring. This function returns a varying character string. The data type of the result has a length equal to that of the input argument (although the value may be shorter).
SUBSTR function returns a substring. This example,
SUBSTR('ABC' FROM 2)
Returns BC.
This example,
SUBSTRING('ABC' FROM 1 FOR 2)
returns AB.
This example,
SUBSTR('ABC', 10)
returns ABC.
iWay Software |