Concatenation Operator

The concatenation operator, which you can specify using either the symbol || or the word CONCAT, concatenates its right operand onto the end of its left operand; it operates on character string or bit string expressions.

Since all built-in data types are implicitly converted to strings, this function can act on all built-in data types.


   { CharacterExpression  ||  CharacterExpression } |
   { CharacterExpression  CONCAT  CharacterExpression } |
   { BitExpression  ||  BitExpression }
   { BitExpression  CONCAT  BitExpression }


An expression.


An expression.


You can specify more than two argument; you MUST specify at least two arguments.


For character strings:

  • If both the left and right operands are of type  VARCHAR.
  • The normal blank padding/trimming rules for CHAR and VARCHAR apply to the result of this operator.
  • The length of the resulting string is the sum of the lengths of both operands.


   -- returns 'San Francisco Giants'
splice> VALUES 'San' || ' ' || 'Francisco' || ' ' || 'Giants';

   -- returns NULL
splice> VALUES CAST (null AS VARCHAR(7)) CONCAT 'Something';

   -- returns 'Today it is: 93'
splice> VALUES 'Today it is: ' || '93';

See Also