Usage Notes | OTRIM | Teradata Vantage - Usage Notes - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.