Monday, March 26, 2012

replace"***" in image path field.

I am hoping someone will be able to help me with this.
i have a table of accountholders with the following fields
account_no
account_name
image_path
the image_path field has a defaultvalue images/***.jpg
I am looking for a query code to update the value in the image_path field by replacing the *** value with the value of the

account_no fieldupdate accountholders
set image_path = replace(image_path, '***', account_no)

EDIT: safer would be:

update accountholders
set image_path = replace(image_path, '***', account_no)
where image_path='images/***.jpg'

No comments:

Post a Comment