Oracle INITCAP Function is used to convert the first alphabet of each word in a string to upper case and the rest of the letters in each word of the string to lower case.SQL INITCAP Function can be used on a table column to get values in INITCAP format.
Oracle INITCAP Function Syntax
SELECT INITCAP(string) FROM table_name;
In the above Oracle INITCAP Function Syntax:-
string is the string whose first alphabet of each word will be converted to upper case and rest of the letters of each word will be in lower case .
Oracle INITCAP Function – Using SQL SELECT Statement Example
Oracle INITCAP Function is used with the SQL SELECT statement.
For example, the SQL INITCAP Function query below returns the INITCAP version of the string passed.
SELECT INITCAP('tech honey') FROM dual;
The above return SQL INITCAP Function query returns ‘Tech Honey’.
Oracle INITCAP Function – Converting UPPER CASE to INITCAP
Oracle INITCAP Function can convert an upper case word to INITCAP.
For example, the SQL INITCAP Function query below returns the INITCAP version of the string passed.
SELECT INITCAP('TECH HONEY') FROM dual;
The above SQL INITCAP Function query returns ‘Tech Honey’.
Oracle INITCAP Function – Use with table column
Oracle INITCAP Function can also be applied to a column or field of a database table.
For example, the SQL INITCAP Function query below returns the name of employees in INITCAP format from employee table.
SELECT INITCAP(employee_name) FROM employee;