TRIM Function Syntax | Teradata Vantage - TRIM Function Syntax - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
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.