Removing Special characters from a field in a table
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Removing Special characters from a field in a table

  1. #1
    Join Date
    Mar 2008
    Posts
    2

    Removing Special characters from a field in a table

    Hi All,

    Could anyone of you please help me out in developing a query.

    My requirement is: The pl/sql code should search for special characters in the columns in a table and if it finds any that should be deleted and rest of the text should be again inserted( without that spl char)

    For eg: table name : temp
    columns are : name, addr1,addr2,addr3
    let the name be kee$@rthi. The script should remove $@ and update the name field with keerthi.
    suggest me how this can be done using loop and substr?

    Please post your thoughts on this.

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    ...and, so far what do you have?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Mar 2008
    Posts
    2

    Exclamation

    Could you please be precise?

  4. #4
    Join Date
    Dec 2000
    Posts
    126
    try TRANSLATE() function

  5. #5
    Join Date
    Apr 2008
    Posts
    6
    Hi Anjana,
    Using translate function you can solve your problem.
    See for example in your case (presently) only two special characters are present, so in translate add those special characters.

    update test1 set name = ( select translate(name,'a$@','a') from temp)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width