Try to search your question here, if you can't find : Ask Any Question Now ?

Oracle SQL regular expression replacement

HomeCategory: stackoverflowOracle SQL regular expression replacement
Avatarsourav asked 1 week ago

I have a Employees Table where I have columns such as last_name first_name,salary,etc..I want to write a query which will replace S or s to ‘K’,K or k to ‘A’,A or a to ‘E’,E or e to ‘S’ for each last_name in the enployees table…basically there are two ways to do it..

1.translate-if I use this I am missing out either on lower case or upper case matching,e.g..translate(last_name,[skae],[kaes])..
2.regexp_replace-tried but from second replacement it is replacing the character with null..regexp_replace(last_name,'[(s|S)(k|K)(a|A)(e|E)]’,[KAES],1,0,’i’]

Thanks a lot.

1 Answers
Best Answer
AvatarAmit answered 1 week ago
Your Answer

10 + 6 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com