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:
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:
Here’s the query to convert all values in a column or expression to proper case:
SELECT INITCAP(email) FROM employees;
Result:
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.