Re: Removing spaces in a field

From: Joseph Y. Suh <josephs_at_clientlink.com>
Date: 1996/05/13
Message-ID: <319755F7.11CE_at_clientlink.com>#1/1


Tony Desborough wrote:
>
> Hi,
>
> How do I use SQL to remove all spaces from a field ?
> e.g update 'EX 300' to 'EX300'
>
> Please reply via email.
> Thanks in advance
> Tony

Try to use TRANSLATE function.

If you want permanent chagnes to the table use;

UPDATE table_1
  SET COL_1 = ( SELECT REPLACE(col_1, ' ','')

                   FROM table_1 );

, or just to display in your reports or screen, use

SELECT REPLACE(col_1, ' ','')

                   FROM table_1 );

Before you make any chagnes or updates to the table, please talk to your DBA or Database Analyst, there may be some reasons why they put the text with space.
Please let me know whether it works.

Joseph Suh
DBA
ClientLink
Alpharetta, Georgia Received on Mon May 13 1996 - 00:00:00 CEST

Original text of this message