SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-164
UPSHIFT Function
UPSHIFT Function
The UPSHIFT function upshifts characters. UPSHIFT can appear anywhere in a query
where a value can be used, such as in a select list, an ON clause, a WHERE clause, a
HAVING clause, a LIKE predicate, an expression, or as qualifying a new value in an
UPDATE or INSERT statement. The result returned by the UPSHIFT function is equal
to the result returned by the UPPER or UCASE function.
UPSHIFT returns a string of either fixed-length or variable-length character data,
depending on the data type of the input string.
You cannot use the UPSHIFT function on KANJI or KSC5601 operands.
UPSHIFT is an SQL/MX extension.
character-expression
is an SQL character value expression that specifies a string of characters to
upshift. See Character Value Expressions on page 6-37.
Examples of UPSHIFT
Suppose that your CUSTOMER table includes an entry for Hotel Oregon. Select
the column CUSTNAME and return a result in uppercase and lowercase letters by
using the UPSHIFT, UPPER, and LOWER functions:
SELECT UPSHIFT(custname),UPPER(custname),UCASE(custname)
FROM sales.customer;
(EXPR) (EXPR) (EXPR)
----------------- ------------------- ------------------
... ... ...
HOTEL OREGON HOTEL OREGON HOTEL OREGON
--- 17 row(s) selected.
Perform a case-insensitive search for the DataSpeed customer:
SELECT *
FROM sales.customer
WHERE UPSHIFT (custname) = 'DATASPEED';
CUSTNUM CUSTNAME STREET CITY ...
------- ---------- -------------------- --------- ...
1234 DataSpeed 300 SAN GABRIEL WAY NEW YORK ...
--- 1 row(s) selected.
In the table, the name can be in lowercase, uppercase, or mixed case letters.
UPSHIFT (character-expression)