Home » Oracle SQL » Oracle INITCAP

Oracle INITCAP

INITCAP is a case manipulation function which converts the first character of string to uppercase and other letters into lowercase.

Here’s the syntax for Oracle INITCAP function

INITCAP ( column-name/ expression)

INITCAP is a special function that works with string or text data types. It is a case manipulation function just like UPPER and LOWER functions.

Let’s have a look at some examples:

INITCAP Function Examples

1. Converting a string into proper case

Let’s convert a simple string into proper case using this query:

SELECT 
LOWER( 'welcome to QUROSITY' )
FROM
dual;

Result:

Convert first letter to uppercase using INITCAP

The query converts the first letter of each word to Uppercase and rest to lowercase characters.

2. Converting the text in a column into proper case using INITCAP

Here, we use the Employee table for this query:

Employee Table from HR Schema

Here’s the query to convert all values in a column or expression to proper case:

SELECT INITCAP(email) FROM employees;

Result:

INITCAP to convert the first character in columns to uppercase Oracle

The first character of each word is capitalized and other characters in a word are converted to lowercase.

In this tutorial we learned how INITCAP is used to convert a string into proper case.