UPPER¶
The UPPER function in SQL converts all lowercase alphabetic characters in a specified string to uppercase.
Syntax¶
Parameters¶
string: The original string to convert.
Return Value¶
The function returns a new string that is the same as the original string, but with all lowercase characters converted to uppercase. Non-alphabetic characters in the string are unaffected.
Errors¶
- If the
stringargument is not a string, aFunctionRequiresStringValueerror will be returned.
Examples¶
Consider a table Item created and filled with the following data:
You can use the UPPER function to convert all name values to uppercase:
This will return:
Note that the UPPER function affects only alphabetic characters. Non-alphabetic characters in the string remain unchanged.