Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Replace unwanted chars in data with a space?
In article <3B5DBC05.823F455B_at_courts.state.ny.usNOSPAM>, Bob says...
>
>Does anyone have a way of finding an unwanted char (say, a semi colon ;
>)in a varchar2 data field and if it is found, removing it and replacing
>it with a space? Preferabley, I would like to include a series of chars
>to be seached for:
>Something to take this:
>Jordan; Rd.
>and leave
>Jordan Rd.
>These are typos in conversion data that woun't pass our edits. Thanks.
>I've recieved much needed help from this group.
> Bob Maggio
>
tkyte_at_TKYTE901.US.ORACLE.COM> select replace( 'Jordan; Rd.', ';', ' ' ) from dual;
REPLACE('JO
works for the single character, to translate a set of characters into a set of other characters:
tkyte_at_TKYTE901.US.ORACLE.COM> select translate( 'Jordan; Rd.', ';.', ' ' ) from dual;
TRANSLATE('
make the ' ' as long as the ';.'
-- Thomas Kyte (tkyte@us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Tue Jul 24 2001 - 15:25:14 CDT