Table of Contents

Search

  1. About the Data Vault SQL Reference
  2. Introduction to SQL Reference for Informatica Data Vault
  3. Date and Time Arithmetic
  4. WHERE Clauses
  5. UNION Operator
  6. Parameterized Query
  7. Functions

Data Vault SQL Reference

Data Vault SQL Reference

TRIM

TRIM

A string function that trims the specified character (
character
) from the beginning and/or end of the input string (
value-expression
) and returns the resulting string. The default trim action is BOTH, and the default
character
value is a blank space. Only a single character can be specified for
character
. If the specified leading/trailing character is not found, the input expression is returned unchanged.

TRIM Syntax

TRIM ( [ [ LEADING | TRAILING | BOTH ] [ char character ] FROM ] char value-expression )

TRIM Examples

Input
Output
' midriff '
'midriff'
TRAILING, ' midriff '
' midriff'
LEADING 's' FROM 'ssssSmokin'
'Smokin'
CREATE TABLE string_table (col1 CHAR(20)); INSERT INTO string_table VALUES (' midriff '); 1 row affected SELECT TRIM (col1) FROM string_table; 1 row selected 1 -------------------- midriff SELECT TRIM(TRAILING FROM col1) FROM string_table; 1 row selected 1 -------------------- midriff SELECT TRIM(LEADING 's' FROM 'ssssSmokin') FROM string_table; 1 row selected 1 ---------- Smokin

0 COMMENTS

We’d like to hear from you!