Hello,
I need to convert description into the title case, i.e. first letter of each word should be capitalized. INITCAP is almost good for it, except that it also capitalizes first letter after apostrophe
SELECT INITCAP('ken''s food near mc''donalds in o''hare''s oasis') FROM DUAL;
gives you
Ken'<font color="red">S</font> Food Near Mc'Donalds In O'Hare'<font color="red">S</font> Oasis
Finally I build this:
SELECT REPLACE(initcap(REGEXP_REPLACE(TRIM('ken''s food near mc''donalds in o''hare''s oasis'), '('')(.)( |$)', chr(254)||'\2\3')), chr(254), '''') FROM DUAL;
it works as expected
Ken's Food Near Mc'Donalds In O'Hare's Oasis
Is there more elegant solution?