background image
<< The COALESCE function | COUNT is an aggregate function >>

Concatenation operator

<< The COALESCE function | COUNT is an aggregate function >>
Derby Reference Manual
122
Concatenation operator
The concatenation operator, ||, concatenates its right operand to the end of its left
operand. It operates on a character or bit expression.
Because all built-in data types are implicitly converted to strings, this function can act on
all built-in data types.
Syntax
{
{ CharacterExpression || CharacterExpression } |
{ BitExpression || BitExpression }
}
For character strings, if both the left and right operands are of type CHAR, the resulting
type is CHAR; otherwise, it is VARCHAR. The normal blank padding/trimming rules for
CHAR and VARCHAR apply to the result of this operator.
The length of the resulting string is the sum of the lengths of both operands.
For bit strings, if both the left and the right operands are of type CHAR FOR BIT DATA,
the resulting type is CHAR FOR BIT DATA; otherwise, it is VARCHAR FOR BIT DATA.
Examples
-- returns 'supercalifragilisticexbealidocious(sp?)'
VALUES 'supercalifragilistic' || 'exbealidocious' || '(sp?)'
-- returns NULL
VALUES CAST (null AS VARCHAR(7))|| 'AString'
-- returns '130asdf'
VALUES '130' || 'asdf'
COS function
The COS function returns the cosine of a specified number.
The specified number is the angle, in radians, that you want the cosine for. The specified
number must be a
DOUBLE PRECISION
number.
· If the specified number is NULL, the result of this function is NULL.
Syntax
COS ( number )
COSH function
The COSH function returns the hyperbolic cosine of a specified number.
The specified number is the angle, in radians, that you want the hyperbolic cosine for.
The specified number must be a
DOUBLE PRECISION
number.
· If the specified number is NULL, the result of this function is NULL.
· If the specified number is zero (0), the result of this function is one (1.0).
Syntax
COSH ( number )
COT function
The COT function returns the cotangens of a specified number.