Home » SQL & PL/SQL » SQL & PL/SQL » I need INITCAP to ignore apostrophes.
I need INITCAP to ignore apostrophes. [message #2681] Tue, 06 August 2002 08:06 Go to next message
Linz
Messages: 1
Registered: August 2002
Junior Member
I'm using INITCAP to propercase a column of results. However when a result has an apostrophe, it capitalizes the next letter. I don't want it to do that.
example:
What I get now is: Women'S Tops
I want: Women's Tops

HELP??
Re: I need INITCAP to ignore apostrophes. [message #2683 is a reply to message #2681] Tue, 06 August 2002 08:31 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
may this helps you.
im just replaccing apostropes with some absurd characters , then apply initcap and replace them back.
i tried with '%' to replace the quotes. doesnt work.
may be..someone gives a good workaround
local@ >select * from ts;

NAME
------------------------------
womens's tops

local@ >select replace(initcap(replace(name,'''','zxqw')),'zxqw','''') name from ts;

NAME
----------------------------------------------------------------------------------------------------
Womens's Tops

Re: I need INITCAP to ignore apostrophes. [message #2694 is a reply to message #2681] Tue, 06 August 2002 19:49 Go to previous messageGo to next message
Raymond
Messages: 30
Registered: September 2000
Member
alright try this. if anyone has a better way please email me?
select concat(concat(initcap('woman'), '''s '), initcap('tops')) from whatever;

hope this helps
Re: I need INITCAP to ignore apostrophes. [message #2696 is a reply to message #2681] Tue, 06 August 2002 22:47 Go to previous message
Deepa
Messages: 269
Registered: November 2000
Senior Member
hi,
to solve u'r problem use replace function to replace the "'" single quote character with some value like '0' then use initcap function to convert the first character to uppercase and again use replace fnction to replace '0' with "'" single quote character.
following query solve u'r problem:
select replace(Initcap(replace('women'||''''||'stop','''',0)),'0','''') from dual;
Previous Topic: Sending emails,sms.......
Next Topic: Finding a column name of a column you know the value of.
Goto Forum:
  


Current Time: Wed May 07 00:17:23 CDT 2025