50 pts.
 sql update command to change text
I need to modify all characters within a text field. Some of the fields will contain 2-5 characters, others will contain 20-200 or more. The field is defined as Text 4000. I want to replace every letter with "K"

We have a Select statement: select TRANSLATE(UPPER(field_name),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','XXXXXXXXXXXXXXXXXXXXXXXXXX') field_name from my_table

But need to have an UPDATE to replace all the text so that the field is completely unreadable since it could contain private information and we need to use it for testing.



Software/Hardware used:
ASKED: September 24, 2009  4:04 PM
UPDATED: September 24, 2009  4:45 PM

Answer Wiki:
UPDATE table SET column= REPLACE(TRANSLATE(UPPER(column),'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'ZZZZZZZZZZZZZZZZZZZZZZZZZZ'),'Z','K')
Last Wiki Answer Submitted:  September 24, 2009  4:45 pm  by  Mji   50 pts.
All Answer Wiki Contributors:  Mji   50 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _