Caché MultiValue Basic Reference
Returns a dynamic array of substrings, based on a delimiter.
||An expression that resolves to a dynamic array. The source dynamic array from which a dynamic array of substrings is to be extracted.
||An expression that resolves to a single character, specified as a number or a string. This character is used as a delimiter to identify substrings within elements. This character cannot also be used as a data value within dynarray. The delimiter characters used in dynamic arrays are listed in the Dynamic Arrays general concepts page of this manual.
||An expression that resolves to an integer that specifies which substring to return from each element of dynarray. Substrings are separated by a delimiter, and counted from 1. A decimal number is truncated to an integer. A string is parsed as a number until a non-numeric character is encountered. Thus 7dwarves is parsed as 7. A count value of 0, a negative number, the null string, or a non-numeric string is the same as count=1.
||Optional An expression that resolves to an integer specifying the number of delimited substrings to return for each element, starting with count. If omitted, the default is 1.
function returns a dynamic array of substrings. Each substring is the n
th piece of each element, where the integer n
is specified by the count
parameter, and substrings are separated by a delimiter
character. The delimiter itself is not returned.
is 1, FIELDS
returns the first piece of each element. This is the piece of the string from the beginning of the element to the first delimiter. If the first character of the element is a delimiter, count
=1 returns the null string.
is greater than the number of delimited substrings in an element, FIELDS
returns the null string for that element.
If the optional range
argument is set to an integer value greater than 1, that number of sequential delimited substrings is returned as a single string. Delimiters within the string are included. If range
is a decimal number, it is truncated to its integer value. Setting range
to any value other than a numeric 2 or greater is treated as setting it to 1. If range
is larger than the number of remaining substrings in the element, the remaining substrings are returned.
function returns delimited substrings from a dynamic array. The FIELD
functions can be used to return a delimited substring from a string.
The following example uses the FIELDS
function to return the area code from each telephone number element in an array, using the hyphen (-) as a delimiter:
! Returns: 617ý401ý603ý508