Thursday, June 24, 2010

sql update insert space before caps and capitalize first charachter

I was loading up EAILoolup Values for use in a interation module I had. The external values where strings without spaces and first letter of each word was capitalized.

 

Like this

 

reopenedOnClientRequest.

 

Its equivalent Siebel value to be show was

 

Reopened On Client Request.

 

So I figured all I needed was an SQL update statement to replace a space before each capitalized letter and make the first letter caps…

 

select initcap(regexp_replace(EXT_VALUE,'([^^])([A-Z])','\1 \2')) from S_EAI_LOOKUPMAP where LOOKUP_TYPE = 'ClaimStatus’

 

This did the trick !