TRIM_ARRAY
The TRIM_ARRAY function returns a copy of the array argument from which the specified number of elements have been removed from the end of the array.
- array-variable-name
- Identifies an SQL variable or parameter. The variable or parameter must be of an array type.
- integer or variable
- An integer or SQL variable or parameter that is a built-in integer data type that specifies the number of elements that will be trimmed from the copy of array-variable-name. The cardinality of the result is decreased by the number of elements trimmed.
The result array type is identical to the array type of the first argument.
The result can be null; if either argument is null, the result is the null value.
TRIM_ARRAY can only be used in an SQL procedure as the only expression on the right side of an assignment-statement.
Example
Remove the last element from SQL array variable p_phonenumbers.
SET p_phonenumbers = TRIM_ARRAY(p_phonenumbers, 1)