Subject | Re: [firebird-support] Getting rid of extra spaces |
---|---|
Author | Milan Babuskov |
Post date | 2004-10-17T18:56:14Z |
Nick Upson wrote:
application that does it. The algorithm is simple:
while (double space exists in field)
replace double space with single space;
If you must do it in database, you can write an UDF, or stored
procedure. SP may be a little awkward way of doing it, you would have to
use go though value, search for ' '. You can use a simple loop and
substring for that. And to replace ' ' with ' ', use substring and
concatenation ||
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org
> I want to get rid of extra spaces between words in a varchar fieldThe best would be to do it from your application, or write a simple
>
> Can anyone reccommend a method?
application that does it. The algorithm is simple:
while (double space exists in field)
replace double space with single space;
If you must do it in database, you can write an UDF, or stored
procedure. SP may be a little awkward way of doing it, you would have to
use go though value, search for ' '. You can use a simple loop and
substring for that. And to replace ' ' with ' ', use substring and
concatenation ||
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org