Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    84

    Unanswered: Replacements of substrings in strings

    This is not a piece of cake as I thought.

    Have to replace few characters with few other characters in the string.

    Now, I am using nested Replace:

    (Replace(Replace(MyString,'','UE'),'','OE')

    This example is simplified, number of replacements is more than eight of them.

    Is there any other, more elegant, way to do this in just one command?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    No, but if you find yourself doing the same REPLACE in several places in your code, you can roll it into a function for ease of programming and clarity.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Please ealborate a little....first read the sticky at the top of the forum...but my guess is you need to fix a table in one shot...

    I would write a view, unload it, then reload the table...

    Just a guess though

    I hate DB2 OS/390
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

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