PDA

View Full Version : Replacing substring in database field


Kohhal
02-12-2004, 12:08 PM
Hi,

I need to change a value in one of my fields so that the string "%20" would be replaced by a space, " ".

Eg. in the field the value "United%20States" would change to "United States", how do I achieve this?

Thanks in advance,

G :)

Xenon
02-12-2004, 12:16 PM
UPDATE table
SET fieldname = REPLACE(fieldname, '%20', ' ')

g-force2k2
02-12-2004, 04:35 PM
Just for references it seems that you inserted a string that was urlencode, so to prevent this in the future you could always urldecode the string before inserting it into the database.

Cheers,
g-force2k2

Kohhal
02-13-2004, 08:31 AM
Thanks guys.

In vB2 it needed to be in that urlencode format, but it seems in vB3 it needs to be the other way.

Cheers!!!

G :)