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 (default value: yes), a double pipe (||) symbol is interpreted as an OR operator. If plus_as_concat is set to no (default value: yes), a plus (+) symbol is interpreted as a plus (+) operator. In such case, It is recommended to concatenate strings or bit strings, by using the CONCAT function.
concat_operand1 + concat_operand1
concat_operand2 || concat_operand2
concat_operand1 :
• bit string
• NULL
concat_operand2 :
• bit string
• character string
• NULL
SELECT 'CUBRID' || ',' + '2008';
'CUBRID'||','+'2008'
======================
'CUBRID,2008'
SELECT 'cubrid' || ',' || B'0010' ||B'0000' ||B'0000' ||B'1000';;
'cubrid'||','||B'0010'||B'0000'||B'0000'||B'1000'
======================
'cubrid,2008'
SELECT ((EXTRACT(YEAR FROM SYS_TIMESTAMP))||(EXTRACT(MONTH FROM SYS_TIMESTAMP)));
(( extract(year from SYS_TIMESTAMP ))||( extract(month from SYS_TIMESTAMP )))
======================
'200812'
SELECT 'CUBRID' || ',' + NULL;
'CUBRID'||','+null
======================
NULL