Character Operators
- Last Updated: October 5, 2020
- 1 minute read
- DataDirect Connectors
- ODBC
- Cloudera Impala 7.1
- dBase 7.1
- Flat files/Text 7.1
- MySQL 7.1
- Pervasive (Btrieve) 7.1
- XML 7.1
- Documentation
Character Operators
Character expressions can include the following operators:
| Operator | Meaning |
|---|---|
| + | Concatenation, keeping trailing blanks. |
| – | Concatenation, moving trailing blanks to the end. |
The following table shows examples of character expressions.
In the examples, last_name is 'JONES ' and
first_name is 'ROBERT '.
| Example | Resulting Value |
|---|---|
| first_name + last_name | 'ROBERT JONES ' |
| first_name – last_name | 'ROBERTJONES ' |
Note: Some flat-file drivers return character data with trailing
blanks as shown in the table; however, you cannot rely on the driver
to return blanks. If you want an expression that works regardless
of whether the drivers return trailing blanks, use the TRIM function
before concatenating strings to make the expression portable. For
example:
TRIM(first_name) + '' + TRIM(last_name)