update mytable set testcol=translate(testcol,' ,.;:!?',' ')Here's an example:
create table test (testcol varchar2(40)); Insert into test values('This is a test! OK? '); Insert into test values('This, is a test; Whassup? '); COMMIT; SQL> select translate(testcol,' ,.;:!?',' ') from test; TRANSLATE(TESTCOL,',.;:!?','') ---------------------------------------- This is a test OK This is a test WhassupThere is one little trick that you might not notice by reading this;
translate(column,' ,.;:!?',' ') _ _ (where _= space!!!)You can of course apply this to any table, column.
set heading off set echo off spool c:\tmp.lst --script an update for each column select 'UPDATE "'||table_name||'" SET "' ||column_name||'"=translate("'||column_name||'",'|| ''''||' ,.;:!?'||''''||','||''''||' '||''''||');' from user_tab_columns where data_type='VARCHAR2'; --run the script --EXECUTE DBMS_OUTPUT.PUT_LINE('COMMIT'); @c:\tmp.lst COMMIT;NOTES: