SQL/MX 3.2.1 Reference Manual (H06.26+, J06.15+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Release 3.2.1 Reference Manual—691117-004
8-2
Character String Functions
Note that columns and expressions can be arguments of an aggregate function. The
expressions cannot contain aggregate functions or subqueries.
An aggregate function can accept an argument specified as DISTINCT, which
eliminates duplicate values before the aggregate function is applied. Only one
DISTINCT aggregate function is allowed at each level of a SELECT statement. Multiple
DISTINCT aggregates are allowed if they are on the same column but are not
permitted on different columns. Exceptions to this rule include MIN and MAX functions
and aggregate functions with unique columns or expressions for which DISTINCT is
unnecessary. See DISTINCT Aggregate Functions on page 2-349.
If you include a GROUP BY clause in the SELECT statement, the columns you refer to
in the select list must be either grouping columns or arguments of an aggregate
function. If you do not include a GROUP BY clause but you specify an aggregate
function in the select list, all rows of the SELECT result table form the one and only
group.
See the individual entry for the function.
Character String Functions
These functions manipulate character strings. These functions either use a character
value expression as an argument or return a result of character data type:
ASCII Function on page 8-11 Returns the ASCII code value of the first character of a
ISO88591 character value expression.
CHAR Function
on page 8-23 Returns the specified code value in a character set.
CHAR_LENGTH Function
on
page 8-24
Returns the number of characters in a string. You can
also use CHARACTER_LENGTH.
CONCAT Function
on page 8-34 Returns the concatenation of two character value
expressions as a string value. You can also use the
concatenation operator (||).
INSERT Function
on page 8-84 Returns a character string where a specified number of
characters within the character string have been deleted
and then a second character string has been inserted at
a specified start position.
LCASE Function
on page 8-87 Downshifts characters. You can also use LOWER.
LEFT Function
on page 8-88 Returns the leftmost specified number of characters
from a character expression.
LOWER Function
on page 8-94 Downshifts single-byte characters. You can also use
LCASE.
LPAD Function
on page 8-99 Replaces the leftmost specified number of characters in
a character expression with a padding character.
LTRIM Function
on page 8-102 Removes the specified characters from the left of the
character string.










