Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011
    Posts
    3

    Unanswered: Replacing File extenstion

    Greetings,
    I'm new to Oracle SQL and I need your help please...
    I have a table called clients and there is a column called pictures..
    I need to update the pictures from ".png" to ".jpg" is that possible?
    I looked in the internet a little bit and I found this command (translate( string1, string_to_replace, replacement_string )).
    Can I use it within a command ?
    Like..
    update pictures from clients where pictures = translate( string1, string_to_replace, replacement_string );
    Is that possible ??!

    Thanks a lot

  2. #2
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Code:
    update clients
        set pictures = replace(pictures, '.png', '.jpg')
    Note that this will replace .png anywhere in the filename.

    More details on the UPDATE statement:
    http://download.oracle.com/docs/cd/B...ents_10007.htm

    More details on the REPLACE function:
    http://download.oracle.com/docs/cd/B...nctions134.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •