DB2 Scalar functions - ARRAY_NEXT
The ARRAY_NEXT function returns the next larger array index value for an array relative to the specified array index argument.
The schema is SYSIBM.
The result is the next larger array index value defined in the array relative to the specified array-index value. If array-index is less than the minimum index array value in the array, the result is the first array index value defined in the array.
The data type of the result of the function is the data type of the array index. The result can be null; if either argument is null, the cardinality of the first argument is zero, or the value of array-index is greater than or equal to the value of the last index in the array, the result is the null value.
SET NEXT_CONSTIDX = ARRAY_NEXT(SPECIALNUMBERS,9)
SET X = ARRAY_NEXT(PHONELIST, 'Dad')
SET X = ARRAY_NEXT(PHONELIST, 'Work')