Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Removing space padding from INSIDE a string?
scholzie wrote:
> My company's database has a field where a part number is. It's supposed
> to be an unbroken string (with no spaces), but the auto-loading
> software is putting spaces in. Example: 'par tnu mber 3' where I really
> want the value 'partnumber3'
>
> I've tried to use trim(' ' from part), but that only takes care of left
> and right padding. How can I remove all the spaces from inside a
> string?
>
> TIA
SELECT TRANSLATE(<column_name>, 'A ', 'A')
FROM <your_table>
Captial 'A' is replaced by itself. All spaces are eliminated no matter where they are and without regard to how many there are.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Thu Oct 20 2005 - 12:49:55 CDT
![]() |
![]() |