Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Update Oracle table to remove whitespace using trim function

Re: Update Oracle table to remove whitespace using trim function

From: <bbcrock_at_gmail.com>
Date: 2 Aug 2006 07:15:09 -0700
Message-ID: <1154528109.666869.25730@b28g2000cwb.googlegroups.com>


Thanks to all responses. this one worked like a charm.

There was no need for a subselect, I simply haven't written a query like the below in years and forgot how to sanitize existing data that way.

btw, I'm on Oracle 9i and my error message was just 01427, single row subquery returns more than one row. When I saw that I realized I was off-base.

thanks!

Don

G Quesnel wrote:
> Can you show us what you have tried,
> and why do you think you need a sub select ?
> To simply remove spaces from the front and/or end of a column is
> trivial ...
> ex: update mytable set colx = trim(colx);
>
> You could even only update rows that require triming, with something
> like...
> update mytable
> set colx = trim(colx)
> where length(colx) > length(trim(colx));
>
> HTH
Received on Wed Aug 02 2006 - 09:15:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US