SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
U-14
UPSHIFT Function
UPSHIFT Function
UPSHIFT is a function that upshifts single-byte characters. UPSHIFT can appear in a
select list, an ON clause, a WHERE clause, a HAVING clause, a LIKE predicate, an
expression, or qualifying a new value in an UPDATE or INSERT statement.
UPSHIFT returns a string of either character or varying-length character data,
depending on the data type of the input string.
For more information, see Character Expressions on page C-14.
character-exp
is a character expression that specifies a string of single-byte characters to upshift.
Considerations—UPSHIFT
If the character expression you specify as an argument to UPSHIFT is associated
with a collation, SQL upshifts the string based on the rules specified in that
collation.
If the argument is not associated with a collation, SQL converts lowercase
characters to uppercase characters according to the usual rules of English.
In version 2, the argument to UPSHIFT could be a column name, a string literal
(without an associated character set), a parameter name, or a host variable name,
but could not be any other form of character expression.
If you use the UPSHIFT function according to version 2 rules, the program will be
at least version 2. If you use the UPSHIFT function according to version 3 rules,
the program will be at least version 3.
Examples—UPSHIFT
This example selects all values from the column CUSTNAME and returns them in
uppercase:
>> SELECT UPSHIFT(CUSTNAME) FROM =CUSTOMER;
This example performs a case-insensitive search for the customer name HOTSYS.
(In the table, the name can be in lowercase, uppercase, or mixed case.)
>> SELECT * FROM =CUSTOMER
+> WHERE UPSHIFT(CUSTNAME) = "HOTSYS";
This example returns all rows from two tables in which department names have the
same value, regardless of case:
>> SELECT * FROM =DEPT1, =DEPT2
+> WHERE UPSHIFT(DEPT1.DEPTNAME) = UPSHIFT(DEPT2.DEPTNAME);
UPSHIFT ( character-exp )