tags:

views:

16

answers:

1

Is it possible to run some SQL to change the contents of a field?

My field looks like this

..//uploaded_images/1284058574.jpg

and I want it to simply be

1284058574.jpg

all the records that I wish to change will start with

..//uploaded_images/
+3  A: 

if it's already in the database you could do a find and replace?

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, '..//uploaded_images/', '(REPLACE TEXT LEAVE EMPTY)');

you may or may not have to character escape the slashes, I'm not sure on that one

Brian Huenefeld