Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

Example of string operators

Example of string operators

The following example shows an expression that concatenates employee first names and employee last names from two columns. This expression removes the spaces from the end of the first name and the beginning of the last name, concatenates a space to the end of each first name, then concatenates the last name:
LTRIM( RTRIM( EMP_FIRST ) || ' ' || LTRIM( EMP_LAST ))
EMP_FIRST
EMP_LAST
RETURN VALUE
' Alfred'
' Rice '
Alfred Rice
' Bernice'
' Kersins'
Bernice Kersins
NULL
' Proud'
Proud
' Curt'
NULL
Curt
NULL
NULL
NULL
You can also use the CONCAT function to concatenate two string values. The || operator, however, produces the same results in less time.

0 COMMENTS

We’d like to hear from you!