Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

CONCAT function (ODBC compatible)


CONCAT ( char_expression , char_expression )


The scalar function CONCAT returns a concatenated character string formed by concatenating argument one with argument two.

The CONCAT scalar function is similar to the concatenation operator. However, the concatenation operator allows easy concatenation of more than two character expressions by nesting the CONCAT function.


SELECT name, empno, salary

FROM customer

WHERE project = CONCAT('US',proj_nam);


  • Both the arguments must be of character type.
  • If one of the arguments is a literal and the other one a field reference, concatenation is possible only if the literal is convertible to the character set of the field reference. Otherwise an error is returned.
  • The result belongs to the character set of the arguments.
  • If any of the argument expressions evaluates to null, the result is null.
  • The trailing blanks for the first arguments are removed.