Oracle UPPER() Function

Oracle UPPER() is a built-in function that returns the uppercase form of a given string.

If you need to convert a string to lowercase, use the LOWER() function.

Oracle UPPER() Syntax

Here is the syntax for the Oracle UPPER() function:

UPPER(str)

Parameters

str

Required. It can be a data of type CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.

Return Value

The Oracle UPPER() function returns the uppercase form of the given string.

If any argument is NULL, UPPER() returns NULL.

Oracle UPPER() Examples

Here are some examples that demonstrate the usage of the Oracle UPPER() function.

Basic Usage

To convert Hello World to uppercase, use the following statement:

SELECT
    UPPER('Hello World') Result
FROM dual;

Output:

RESULT
______________
HELLO WORLD

NULL Argument

If any argument is NULL, UPPER() returns NULL.

SET NULL 'NULL';
SELECT
    UPPER(NULL)
FROM dual;

Output:

UPPER(NULL)
______________
NULL

In this example, we use the SET NULL 'NULL'; statement to display the NULL value as the string 'NULL'.

Conclusion

Oracle UPPER() is a built-in function that returns the uppercase form of a given string.