Toupper
toupper
converts the lower case letters in a string into upper case letters. Other characters remain unchanged.
toupper(STRING_EXPR)
STRING_EXPR
is an expression returning a string or a CLOB variable. # Let's convert lowercase to uppercaseIRRITATED_MESSAGE=toupper("please be quiet!") : # Returns "PLEASE BE QUIET!"# Let's compare strings independently from the caseIf toupper(NAME_1) = toupper(NAME_2)# The two names are identicalEndif# Let's compare strings independently from the case and the accentsIf toupper(ctrans(NAME_1)) = toupper(ctrans(NAME_2))# The two names are identicalEndif# Let's do it with a (French) accentuated messageIRRITATED_MESSAGE=toupper("s'il vous plaît, arrêtez ce bruit ô combien insensé")# returns "S'IL VOUS PLAÎT, ARRÊTEZ CE BRUIT Ô COMBIEN INSENSÉ"
toupper
converts the lower case characters (including the accentuated letters) in the corresponding upper case characters, without changing other characters.
The function ctrans can be used to suppress the accents prior to using the toupper function.
The type of result is Char or Clbfile, depending on the length of the string.
The format$ used with a format that contains only "A", will also perform a toupper
conversion, with the following differences:
* The length of the resulting string will be constant and can include trailing spaces.
* If characters that are not letters are present, the formatting will globally replace the string by a string filled with spaces. This will happen for accentuated characters that are refused by the "A" format.
Error code | Description |
---|---|
10 | The argument is not a string or CLOB. |