Discussion Locked

Cleansing Data

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a nightly feed coming from an Oracle Database. The data is all in caps and I would like to run a script which will reformat the data in a presentable format (upper and lower case). The fields include name, address, phone number.

If someone has a list of all the exceptions I need to include in my script that would be helpful.
(Example: DiNiro, Mary-Beth)

5 replies

by rcavalca

Why don't you use the character function initcap. This function will show
all first to upper and others to lower.
for example:
JOHN SMITH ==> John Smith <----+
|
select initcap(name) from tab; -----+

by anurag

You can use the initcap() function. It will make the the first alpabet as capital and the rest as small in a word.
For example ORACLE will be shown as Oracle.

While queying you can use the function as
select initcap(fieldname) from tablename;
If field name is ORACLE it will be shown as Oracle.

Anurag

This discussion is closed to new replies.