SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual—523725-004
9-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-197.
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 9-12 Returns the ASCII code value of the first character of a 
ISO88591 character value expression.
CHAR Function
 on page 9-25 Returns the specified code value in a character set.
CHAR_LENGTH Function
 on 
page 9-26
Returns the number of characters in a string. You can 
also use CHARACTER_LENGTH.
CODE_VALUE Function
 on 
page 9-29
Returns an unsigned integer that is the code point of the 
first character in a character value expression that can 
be associated with any character sets allowed.
CONCAT Function
 on page 9-30 Returns the concatenation of two character value 
expressions as a string value. You can also use the 
concatenation operator (||). 
INSERT Function
 on page 9-65 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 9-68 Downshifts characters. You can also use LOWER.
LEFT Function
 on page 9-69 Returns the leftmost specified number of characters 
from a character expression.
LOCATE Function
 on page 9-70 Returns the position of a specified substring within a 
character string. You can also use POSITION.
LOWER Function
 on page 9-74 Downshifts single-byte characters. You can also use 
LCASE.










