Oracle Tutorial

  • Home
  • Start Here
  • Basics
  • Advanced
    • Oracle View
    • Oracle Index
    • Oracle Synonym
    • Oracle Sequence
    • Oracle Administration
  • PL/SQL
  • Functions
    • Aggregate Functions
    • Analytic Functions
    • Comparison Functions
    • Date Functions
    • String Functions
  • API
    • Python Oracle
Home / Oracle String Functions / Oracle UPPER

Oracle UPPER

The Oracle UPPER() function converts all letters in a string to uppercase.

Syntax

The following illustrates the syntax of the Oracle UPPER() function:

UPPER(string)

Arguments

The UPPER() function takes one argument:

1) string

is the string which is converted to uppercase

Return value

The UPPER() function returns a string with all letters in uppercase.

Examples

The following statement converts  the string 'string function' to uppercase:

SELECT UPPER( 'string functions' ) FROM dual;

Here is the result:

'STRING FUNCTIONS'

Let’s see the contacts table in the sample database:

contacts table

The following statement groups contacts by their initials and returns the number of contacts for each alphabet.

SELECT UPPER( SUBSTR( first_name, 1, 1 ) ) initials, COUNT( * ) FROM contacts GROUP BY UPPER( SUBSTR( first_name, 1, 1 ) ) ORDER BY initials

The following picture illustrates the result:

Oracle UPPER function example

You can use the UPPER() function to perform case insensitive search for values in a column. To demonstrate this, let’s update the last name of the contact id 38 from Hill to HILL:

UPDATE contacts SET last_name = 'HILL' WHERE contact_id = 38;

To find contacts whose last name is Hill, HILL, or hill, you use the UPPER() function in the WHERE clause as follows:

SELECT contact_id, first_name, last_name, email FROM contacts WHERE UPPER( last_name ) = 'HILL';

Here is the result:

Oracle UPPER - case insensitive search

In this tutorial, you have learned how to use the Oracle UPPER() function to convert all letters of a string to uppercase.

  • Was this tutorial helpful?
  • YesNo
Previous Oracle TRANSLATE

Oracle Functions

  • Aggregate Functions
  • Analytic Functions
  • Comparison Functions
  • Date Functions
  • String Functions

String Functions

  • ASCII
  • CHR
  • CONCAT
  • CONVERT
  • DUMP
  • INSTR
  • INITCAP
  • LENGTH
  • LOWER
  • LPAD
  • LTRIM
  • REPLACE
  • REGEXP_COUNT
  • REGEXP_INSTR
  • REGEXP_LIKE
  • REGEXP_REPLACE
  • REGEXP_SUBSTR
  • RPAD
  • RTRIM
  • SOUNDEX
  • SUBSTR
  • TRANSLATE
  • TRIM
  • UPPER

About Oracle Tutorial

OracleTututorial.com website provides Developers and Database Administrators with the updated Oracle tutorials, scripts, and tips.

Search

Recent Tutorials

  • Oracle Implicit Statement Results
  • Calling PL/SQL Stored Functions in Python
  • Calling PL/SQL Procedures in Python
  • Managing Transaction in Python
  • Deleting Data From Oracle Database in Python

Site Links

  • Oracle Books
  • About
  • Contact
  • Privacy Policy
  • Terms of Use

Copyright © 2021 Oracle Tutorial. All Rights Reserved.