sql update command to change text

50 pts.
Tags:
Oracle 9i
SQL
TEXT
Update
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

UPDATE table SET column=
REPLACE(TRANSLATE(UPPER(column),’ABCDEFGHIJKLMNOPQRSTUVWXYZ’,
‘ZZZZZZZZZZZZZZZZZZZZZZZZZZ’),’Z’,’K’)

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following