Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to change file extensions 1

Status
Not open for further replies.

deecee

Technical User
Aug 25, 2001
1,678
US
I have a column in a table with image locations

filename.jpg

i need to change all the extensions to

filename.eps

what would be easier then deleting the column and adding an new column with all the info?

thanks

zzzzzz
 
How about something like:
[tt]
UPDATE tbl SET fld=REPLACE(fld,'.jpg','.eps')
[/tt]



-----
ALTER world DROP injustice, ADD peace;
 
will this change the whole column -- asuuming colomn name is images -- how would this target that colomn

Select images FROM items UPDATE tbl SET fld=REPLACE(fld,'.jpg','.eps')

would this be correct to perform the required task?

zzzzzz
 
Your suggestion will not work at all, it's not valid SQL.
[tt]
UPDATE tbl SET fld=REPLACE(fld,'.jpg','.eps')[/tt]
will examine every record in the table called tbl, changing the value stored in the column named fld so that every occurrence of '.jpg' is changed to '.eps'.


-----
ALTER world DROP injustice, ADD peace;
 
but i only need one column -- i have other columns that point to thumbnails -- and larger images that i need to keep jpg.

the column that points to images for print need to be eps.

zzzzzz
 
The SQL I posted will only affect the column named fld. All other columns will remain unchanged.

-----
ALTER world DROP injustice, ADD peace;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top