Quantcast
Channel: Interactive.Octopus » SQL
Viewing all articles
Browse latest Browse all 2

Oracle / PLSQL: InitCap Function

$
0
0

When running Oracle PL/SQL Queries, if you want to make a value “title case”, where the first letter of each word is capitalized, then use the INITCAP() function. The syntax for that looks like this:

INITCAP( myString );

For example:

INITCAP('JOHN DOE');
/* Retruns 'John Doe' */

INITCAP('This is the best blog ever');
/* Retruns 'This Is The Best Blog Ever' */

I use this a lot of prefixes of names like Mr and Mrs. Just note that it’s not full proof as “PhD” would get translated into “Phd” which tends to make the Phd not so happy!

:) Happy coding!


Viewing all articles
Browse latest Browse all 2

Trending Articles