TRIM Function (SQL)

Help Contents

Introduction

The SQL TRIM function removes characters from the start or end of a string.

Syntax

primary-function-trim ::=
  TRIM '(' trim-operands ')'

trim-operands ::=
  [ [ trim-specification ] [ trim-character ] FROM ] trim-source

trim-specification ::=
  LEADING
  | TRAILING
  | BOTH

trim-character::=
  value-expression

trim-source::=
  value-expression

Remarks

The TRIM function removes characters from the start or end of a string.

If trim-character is not specified, the default value is a space character. If trim-character is specified, the result must be a string of length 1.

If trim-specification is not specified, BOTH is assumed.

If either trim-character or trim-source is NULL, the TRIM function returns NULL.

Further Information

Value Expressions (SQL)

To learn more about SQL scalar value expressions.

Fernhill SCADA Structured Query Language (SQL)

To learn more about the SQL features in Fernhill SCADA.

Glossary

For the meaning of terms used in Fernhill SCADA.