Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use replace function to replace word

user6287828Apr 1 2013 — edited Apr 2 2013
I am trying to write a replace function in which I replace CA with California in an address string.

I am trying to avoid using regular expression and just use other functions like replace, instr, trim etc.

But what my main confusion is how do i take care of three cases in which.

CA can be present with spaces before and after it like.

- Redwood City, CA 96403

CA can be present with spaces only before it and after it the string ends.

- Redwood City, CA

and I do not want to replace any other CA in the string that is part of other word

- Blaca Street CA
( for example do not replace ca in Blaca)

or

- Cardinal Dr CA

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2013
Added on Apr 1 2013
14 comments
573 views