Specify a character string value or a binary string value.
Syntax
| |
<character value expression> { || | + } <character primary> |
Notes
♦ | The declared type of a character primary shall be a character string type. |
♦ | The declared type of a blob primary shall be a binary string type. |
♦ | Two character strings can only be concatenated if they share the same character set and are comparable. |
♦ | The concatenation operator and the arithmetic plus operator can be used interchangeably to concatenate string values. If character string concatenation is specified, then the length of the result is the combined length of the two values, up to the maximum length for the data type. |
♦ | If either of the operands are a character large object type, then the result type of the concatenation is CHARACTER LARGE OBJECT or NATIONAL CHARACTER LARGE OBJECT. |
♦ | If either of the operands are a variable-length character string, then the result type of the concatenation is CHARACTER VARYING or NATIONAL CHARACTER VARYING. |
♦ | If both operands are fixed-length character strings, then the result type of the concatenation is CHARACTER or NATIONAL CHARACTER. |
♦ | If either of the operands are a national character string type, then the result of the concatenation is a national character string type. |
♦ | If either of the operands are null, then the result of the concatenation is null. |
See also: String Value Functions
Examples
1) | String concatenation using the concatenation operator: |
UPDATE students
SET studentName = firstName || ' ' || lastName
2) String concatenation using the plus operator:
UPDATE students
SET studentName = firstName + ' ' + lastName
Conformance
SQL:2003 standard NexusDB extensions |
- - |
Core SQL Plus sign as string concatenation operator |