1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

replace '&' in oracle query

Discussion in 'Databases' started by Jamie18, Jan 13, 2010.

  1. #1
    does anyone know how replace or regexp_replace '&' or any other ampersand string?

    my first stab at it was this
    SELECT replace(g.name, '\&', '\&')
    FROM groups g
    Code (markup):
    however oracle considers the & as a special character and when i run the query it asks me for the value of the 'AMP' variable.. if i substitute '&' for that value the replace still doesn't work..

    any ideas?
     
    Jamie18, Jan 13, 2010 IP
  2. Jamie18

    Jamie18 Peon

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Solution:

    SELECT regexp_replace(g.name, '\&'||'amp;', '&')
    FROM groups g
    Code (markup):
     
    Jamie18, Jan 13, 2010 IP