0

I'm trying to create and XML feed with the result set of a SQL query. One of the fields contains ' characters which is causing an error in the resulting XML file.

How do I replace the ' character. I've read posts that suggest something like

Replace(my_column,'''','')

But this throws up a syntax error

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
nabid
  • 1

3 Answers3

1

Probably you're looking for something like this:

UPDATE your_table
   SET your_column = REPLACE(your_column, '\'', ''');

But then again, I wonder why it's necessary to do that in DB, and not in the output code.

raina77ow
  • 103,633
  • 15
  • 192
  • 229
1

It should work

select replace('abc''def','''','')

SQLFiddle example

juergen d
  • 201,996
  • 37
  • 293
  • 362
0

Use ' in place of '. This will work:

Replace(my_column,"'",''')
Pierre GM
  • 19,809
  • 3
  • 56
  • 67