16.20 - Usage Notes - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Data Types and Literals

Teradata Database
Teradata Vantage NewSQL Engine
March 2019
Programming Reference

OTRIM takes an array expression as an argument and removes one or more populated elements from the end of the array value. If you do not specify integer_value, then OTRIM removes a single populated element from the end of the array value; otherwise, OTRIM removes the number of populated elements specified by integer_value from the end of the array value. For a multidimensional ARRAY type, this is done in row-major order. OTRIM returns a new modified copy of the array value as the result.

If array_expr is NULL, an error is returned. If integer_value is NULL, no error occurs, but no action is taken by OTRIM. If the number of elements to be removed by OTRIM is greater than the current value of OCOUNT for the array, then an error is returned.

The OTRIM method is compatible with the Oracle TRIM method for one-dimensional ARRAY types. If integer_value is not specified, the empty set of parentheses required by Teradata syntax is a deviation from Oracle syntax.