Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Concatenation Operator

Description

A concatenation operator gets a character string or bit string data type as an operand and returns a concatenated string. The plus sign (+) and double pipe symbol (||) are provided as concatenation operators for character string data. If NULL is specified as an operand, a NULL value is returned.

If pipes_as_concat that is a parameter related to SQL statement is set to no, a double pipe (||) symbol is interpreted as an OR operator. Therefore, to concatenate, a plus operator (+) or the CONCAT function should be used.

Syntax

concat_operand1   +  concat_operand1

concat_operand2   ||  concat_operand2

concat_operand1 :

? bit string

? NULL

 

concat_operand2 :

? bit string

? character string

? NULL

  • concat_operand1 : Left string after concatenation. String or bit type can be specified.
  • concat_operand2 : Right string after concatenation. String or bit type can be specified.
Example

SELECT 'CUBRID' || ',' + '2008';

======================

  'CUBRID,2008'

 

SELECT 'cubrid' || ',' || B'0010' ||B'0000' ||B'0000' ||B'1000'FROM db_root;

======================

  'cubrid,2008'

 

SELECT ((EXTRACT(YEAR FROM SYS_TIMESTAMP))||(EXTRACT(MONTH FROM SYS_TIMESTAMP)));

======================

  '200812'

 

SELECT 'CUBRID' || ',' + NULL;

======================

  NULL