DB2 Datafix to remove dodgy characters

A quick and dirty db2 datafix to remove some dodgy characters that was causing our application to fail. Of course we also corrected the application to stop inserting these characters in the first place.

DB2 9.7.5

UPDATE devt.LOG 
set message = replace(message,TRIM(TRANSLATE(message, ' ', '(){}<>!;%$#*?@+&_^=-":/''.,0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')),'') 
where length(TRIM(TRANSLATE(message, ' ', '(){}<>!;%$#*?@+&_^=-":/''.,0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ))) > 0

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *