UCASE or UPPER

UCASE or UPPER returns a string in which all alphabetic characters in the input character expression have been converted to uppercase.

UPPER and UCASE follow the database locale unless you specify the Locale parameter.

Syntax

UCASE or UPPER ( CharacterExpression [, Locale ] )

CharacterExpression

A  LONG VARCHAR data type, or any built-in type that is implicitly converted to a string (but not a bit expression).

Locale

Optional. You can specify the locale (language and country) to perform language-specific conversions. If you don’t supply this parameter, the Java Session locale value, which is automatically detected, is used as your locale.

You must specify the locale using the following format: ll_CC, where:

  • ll is a lowercase, two-character ISO-639 language name code.

    Some examples are: de for German, en for English, es for Spanish, and ja for Japanese. You can see a list of the ISO-639 codes here: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.

  • CC is an uppercase, two-character ISO-3166 country code.

    Some examples are DE for Germany, US for the United States, ES for Spain, and JP for Japan. You can see a list of the ISO-3166 codes here: https://en.wikipedia.org/wiki/ISO_3166-1.

For example, you can use de_DE to specify that German language rules should be used when applying this function, or you could specify en_US to apply American English rules.

Results

If the CharacterExpression evaluates to NULL, this function returns NULL.

In general, the type, length, and maximum length of the returned value are the same as the length and maximum length of the CharacterExpression. However, the data type, length, and maximum length of the result can be different if you’re using a locale value that differs from the default locale of your database.

This is because a single character may convert into multiple characters, when a location value is involved. For example, if you’re applying this function to a CHAR value and the resulting value length exceeds the limits of a CHAR value, the result will be a VARCHAR value. Similarly, converting a VARCHAR value may result in a LONG VARCHAR value, and converting a LONG VARCHAR value may results in a CLOB value.

Example

To return the names of players, use the following clause:

splice> SELECT UCASE(DisplayName)
   FROM Players
   WHERE ID < 11;
1
------------------------
BUDDY PAINTER
BILL BOPPER
JOHN PURSER
BOB CRANKER 
MITCH DUFFER 
NORMAN AIKMAN 
ALEX PARAMOUR 
HARRY PENNELLO
GREG BROWN
JASON MINMAN

10 rows selected
splice> SELECT UPPER(DisplayName, 'en_US')
   FROM Players
   WHERE ID < 11;
1
------------------------
BUDDY PAINTER
BILL BOPPER
JOHN PURSER
BOB CRANKER 
MITCH DUFFER 
NORMAN AIKMAN 
ALEX PARAMOUR 
HARRY PENNELLO
GREG BROWN
JASON MINMAN

10 rows selected

See Also