ALPHA(x,n) is a string function that enables a character x (string specification) in ASCII to be converted to a different one or two-character representation defined in the DEFAULTMAP (mapchar_set_name). Only expressions that supply an alphanumeric value are permitted as string specifications.
ALPHA(x,n) is used to define the sort sequence.
The function ALPHA(x,n) uses the MAPCHAR(x,n,i) function internally (where i is the DEFAULTMAP) and also performs a conversion to uppercase letters (UPPER(x)).
Specifying n, an unsigned integer, is optional. n specifies the maximum length of the result.
|
Result of the Function ALPHA(x,n) |
ALPHA(x,n) |
UPPER(MAPCHAR(x,n,DEFAULTMAP)) |
The ALPHA function enables data to be sorted practically, for example, if "ü" is to be treated as "UE" for sorting purposes. The mapchar set with the name DEFAULTMAP is used.
SELECT...,ALPHA(<column_name>) sort,...FROM...ORDER BY sort