skip to main content
SQL Statements for Flat-File Drivers : Select Statement : SQL Expressions : Character Operators
  
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)