List:General Discussion« Previous MessageNext Message »
From:Wm Mussatto Date:June 4 2008 12:29am
Subject:Re: INSERTing values in empty fields
View as plain text  
On Tue, June 3, 2008 16:05, SenTnel wrote:
>
> Hi all!
>
> My database has a lot of empty fields in the "street" column, meaning that
> a
> lot of streets has no name registered, they're just plain blank.
>
> What I would like to do is to INSERT something like "N/A" (Not Available)
> in
> every field that is empty in the "street" column, but don't know exactly
> the
> SQL statemet to tell:
>
> "In mytable, street column, insert 'N/A' in every empty space"
>
> Thanks!!
update mytable set street='N/A' where (rtrim(street)='' or street is NULL)

I always do a
select * from mytable where  (rtrim(street)='' or street is NULL) limit 10

as a test first.

------
William R. Mussatto
Systems Engineer
http://www.csz.com
909-920-9154

Thread
INSERTing values in empty fieldsSenTnel4 Jun
  • Re: INSERTing values in empty fieldsWm Mussatto4 Jun
    • Re: INSERTing values in empty fieldsSenTnel4 Jun