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.