Upshift Function; Examples Of Upshift - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

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 fixed-length or variable-length character data, depending on the
data type of the input string.
UPSHIFT is a Neoview SQL extension.
UPSHIFT (character-expression)
character-expression
is an SQL character value expression that specifies a string of characters to upshift. See
"Character Value Expressions" (page

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)
-----------------
...
HOTEL OREGON
--- 17 row(s) selected.
Perform a case-insensitive search for the DataSpeed customer:
SELECT *
FROM sales.customer
WHERE UPSHIFT (custname) = 'DATASPEED';
CUSTNUM
-------
1234
--- 1 row(s) selected.
In the table, the name can be in lowercase, uppercase, or mixed case letters.
Suppose that your database includes two department tables: DEPT1 and DEPT2. Return all
rows from the two tables in which the department names have the same value regardless
of case:
SELECT * FROM persnl.dept1 D1, persnl.dept2 D2
WHERE UPSHIFT(D1.deptname) = UPSHIFT(D2.deptname);
428
SQL Functions and Expressions
(EXPR)
-------------------
...
HOTEL OREGON
CUSTNAME
STREET
----------
--------------------
DataSpeed
300 SAN GABRIEL WAY
208).
(EXPR)
------------------
...
HOTEL OREGON
CITY
--------- ...
NEW YORK
...
...

Advertisement

Table of Contents
loading

Table of Contents