sqloracle-databaseinformatica-cloud

Replace box characters in Oracle SQL using regex replace


How to replace the box characters from a table in oracle sql using regexp_replace? I tried to specify the unicode escape sequence of the box character in regexp replace but it doesnt work, is there any other way to replace.

Query used: select regexp_replace(colA,'[\u001A]','') from tableA;


Solution

  • How about

    regexp_replace(colA, unistr('\001A'))
    

    If you just want to replace one string, you don't need a regex, and the standard replace will perform better:

    replace(colA, unistr('\001A'))