467,923 Members | 1,891 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

remove spaces from field contents in DB2 database...

Hello all,

I am hoping someone can help me. I have used MySQL (sorry) in the past
and I am struggling with the syntax to do an update on some records in
a DB2 database. I am simply trying to get a list of records that
contains spaces in some_field, then strip all of the spaces. Any help
is appreciated.


Bobby T

Apr 11 '06 #1
  • viewed: 28058
3 Replies
SELECT Some_Field, REPLACE(Some_Field, ' ', '') FROM mytable WHERE
POSSTR(Some_Field, ' ') > 0

Apr 11 '06 #2
Hey Brian,

What about:

select Some_Field, REPLACE(Some_Field, ' ', '') from mytable where
Some_Field like '% %'



Apr 11 '06 #3
That's probably better than mine. Silly me relying on FUNCTIONs..... :)


Apr 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Michael Bulatovich | last post: by
2 posts views Thread by Cliff72 | last post: by
9 posts views Thread by Jeff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.