Concatenation 

A concatenation x||y or x&y is a string function that supplies the following results for x (character string with the length n) and y (character string with the length m):

 

Result of the concatenation

x||y or x&y

x and y are concatenated to a character string with the length n+m.

If a character string originates from a column, its length is determined without any consideration of trailing blanks (code attribute. ASCII, EBCDIC, UNICODE) or binary zeros (code attribute BYTE).

x or y is the NULL value

NULL value

 

Columns with the same code attribute can be concatenated.

Columns with different code attributes (ASCII, EBCDIC and UNICODE) can be concatenated together as well as with date values, time values, and timestamp values.

Model table: customer

SELECT name, city&', '&state&' '&chr(zip) address FROM customer

NAME

ADDRESS

Porter

New York, NY 10580

DATASOFT

Dallas, TX 75243

Porter

Los Angeles, CA 90018

Peters

Los Angeles, CA 90011

Brown

Hollywood, CA 90029

Porter

Washington, DC 20037

Howe

New York, NY 10019

Randolph

Chicago, IL 60601

Peters

Los Angeles, CA 90013

Brown

Los Angeles, CA 90008

Jackson

Los Angeles, CA 90005

Adams

Los Angeles, CA 90014

Griffith

New York, NY 10575

TOOLware

Los Angeles, CA 90002

Brown

Hollywood, CA 90029