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!

Best way to replace characters

SweAnderlineJan 27 2010 — edited Jan 27 2010
Hi

Im having some data corruption on the database where the german letters have been replaced by certain symbols.

These letters have been replaced by:
ü = }
ä = {
ö = |

So instead of Grübbestrasse, its Gr}bbestrasse.

I now want update alot of this data but Im considering which way is the best to go.
One way which Iv considered (but I dont think is the best) is this:

I substring the address from start pos 0 to pos where the "}" ends (then minus 1) - concat with the real letter - subString where the "}" starts and where the column ends.

update address_table
set address_1 = subStr(address1,0,(instr(address1,'}')-1)) ||'ü'|| subStr(address1,(inStr(address11,'}')+1),20)



Do you have any better ideas ?
Because I know this will not work if I have more then 1 wrong character in the same address.


Cheers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2010
Added on Jan 27 2010
2 comments
616 views