CONCAT

The CONCAT function combines two compatible string arguments.

Read syntax diagram
>>-CONCAT(string-expression-1,string-expression-2)-------------><

The schema is SYSIBM.

The arguments must be compatible strings. For more information on compatibility, refer to the compatibility matrix in Table 1.

Start of changeEither argument can also be a numeric data type. The numeric argument is implicitly cast to a VARCHAR data type.End of change

The result of the function is a string that consists of the first string followed by the second string.

The result can be null; if any argument is null, the result is the null value.

The CONCAT function is identical to the CONCAT operator. For more information, see Expressions with the concatenation operator.

Example: Using sample table DSN8A10.EMP, concatenate column FIRSTNME with column LASTNAME. Both columns are defined as varying-length character strings.
   SELECT CONCAT(FIRSTNME, LASTNAME)
     FROM DSN8A10.EMP;