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 ( code tables)) or binary zeros (code attribute BYTE). |
x or y is the NULL value |
NULL value (see data type) |
Columns with the same code attribute can be concatenated.
Columns with different code attributes (ASCII and EBCDIC) can be concatenated together and with
date values, time values, and timestamp values.
Model table:
SELECT name, city&', '&state&' '&chr(zip) address FROM customer
NAME |
ADDRESS |
Porter |
New York, NY 10580 |
DATASOFT |
Dallas, TX 75243 |
Randolph |
Los Angeles, CA 90018 |
Smith |
Los Angeles, CA 90011 |
Brown |
Hollywood, CA 90029 |
Jackson |
Washington, DC 20037 |
Howe |
New York, NY 10019 |
Miller |
Chicago, IL 60601 |
Peters |
Los Angeles, CA 90013 |
Baker |
Los Angeles, CA 90008 |
Jenkins |
Los Angeles, CA 90005 |
Adams |
Los Angeles, CA 90014 |
Griffith |
New York, NY 10575 |
TOOLware |
Los Angeles, CA 90002 |
Brown |
Hollywood, CA 90029 |