INITCAP

INITCAP is a SQL function used to convert the first letter of each word in a specified string to uppercase. All other letters in the word are converted to lowercase.

INITCAP(string)

  • string: It refers to the input string on which the INITCAP function is to be applied. This function converts the first letter of each word in the string to uppercase and the rest to lowercase.

Example

SELECT INITCAP('hello WORLD') AS Sample_Output FROM dual;

Output

SAMPLE_OUTPUT
Hello World

Explanation

The INITCAP function in Oracle is used to convert the first letter of each word to uppercase, while the rest of the characters in the word are converted to lowercase. In the given example, ‘hello WORLD’ is converted to ‘Hello World’.

INITCAP(text) RETURNS text

  • text: This is the input string that the INITCAP() function will process. It converts the first letter of each word in the text string to uppercase and the remaining to lowercase.

Example

SELECT INITCAP('hello world');

Output

'Hello World'

Explanation

In this example, the INITCAP function modifies the given string ‘hello world’ by capitalizing the first letter of each word, resulting in ‘Hello World’.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.