By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,590 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,590 IT Pros & Developers. It's quick & easy.

remove spaces from field contents in DB2 database...

P: n/a
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
Share this Question
Share on Google+
3 Replies

P: n/a
SELECT Some_Field, REPLACE(Some_Field, ' ', '') FROM mytable WHERE
POSSTR(Some_Field, ' ') > 0

Apr 11 '06 #2

P: n/a
Hey Brian,

What about:

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



Apr 11 '06 #3

P: n/a
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.