I'm affraid you'll have to use PL/SQL for that. Something like the following function:
Code:SQL> create or replace function remove_blanks_after_comma (p_in in varchar2) 2 return varchar2 as 3 v_out varchar2(4000) := p_in; 4 begin 5 while INSTR(v_out, ', ') > 0 loop 6 v_out := replace(v_out, ', ', ','); 7 end loop; 8 return v_out; 9 end; 10 / Function created. SQL> SELECT remove_blanks_after_comma('Tom, Hanks') FROM dual; REMOVE_BLANKS_AFTER_COMMA('TOM,HANKS') -------------------------------------------------------------------------------- Tom,Hanks SQL> SELECT remove_blanks_after_comma('Tom Hanks') FROM dual; REMOVE_BLANKS_AFTER_COMMA('TOMHANKS') -------------------------------------------------------------------------------- Tom Hanks SQL>




Reply With Quote