TRIM Function Syntax | Teradata Vantage - TRIM Function Syntax - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢
TRIM (
  [ { BOTH | TRAILING | LEADING } [ trim_expression ] FROM ]
  [ character_set ]
  string_expression
)

Syntax Elements

BOTH
TRAILING
LEADING
Specifies how to trim the specified trim character or byte from string_expression.
  • BOTH means trim both trailing and leading characters or bytes.
  • TRAILING means trim only trailing characters or bytes.
  • LEADING mens trim only leading characters or bytes.
If you omit this option, the default is BOTH, and the default trim character is a null byte for byte types and a pad character for character types.
trim_expression
The specific character or byte to trim from the head, tail, or both, of string_expression.
The expression must evaluate to a single character.
You cannot specify trim_expression without also specifying BOTH, TRAILING, or LEADING.
You cannot specify a trim_expression of type KANJI1, nor can you apply a trim_expression to a string_expression of type KANJI1.
character_set
The name of the server character set to associate with the string expression.
Valid values are:
  • _Latin, which is the LATIN server character set
  • _Unicode, which is the UNICODE server character set
  • _KanjiSJIS, which is the KANJISJIS server character set
  • _Graphic, which is the GRAPHIC server character set
string_expression
A byte or character string or string expression to be trimmed.