Open In App

PLSQL | INITCAP Function

Improve
Improve
Like Article
Like
Save
Share
Report

The INITCAP function in PLSQl is used for setting the first character in each word to uppercase and the rest to lowercase.
Words are delimited by white space or characters that are not alphanumeric.
The INITCAP function in PLSQL can accept char can of any of the datatypes such as CHAR, VARCHAR2, NCHAR, or NVARCHAR2. The value returned by the INITCAP function is of the same datatype as char. The database sets the case of the initial characters based on the binary mapping defined for the underlying character set.

Syntax:

INITCAP(string)

Parameters Used:

string:It is used to specify the string whose first character in each word will be converted to uppercase and all remaining characters converted to lowercase.

Return Value:
The INITCAP function in PLSQL returns a string value.

Supported Versions of Oracle/PLSQL:

  1. Oracle 12c
  2. Oracle 11g
  3. Oracle 10g
  4. Oracle 9i
  5. Oracle 8i

Example-1:

DECLARE 
   Test_String string(20) := 'geeksforgeeks';
      
BEGIN 
   dbms_output.put_line(INITCAP(Test_String)); 
   
END; 

Output:

Geeksforgeeks 



Example-2:

DECLARE 
   Test_String string(40) := 'Hello, welcome to geeksforgeeks.';
      
BEGIN 
   dbms_output.put_line(INITCAP(Test_String)); 
   
END; 

Output:

Hello, Welcome To Geeksforgeeks. 

Last Updated : 20 Sep, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads