This is similar to How do I query a string in Arcobjects that has a single quote in it? but in my case the apostrophe is actually in the word I'm searching for: &where=locality = 'O'CONNELL'

This fails in an ArcGIS Server query:

enter image description here

  • This is also similar to stackoverflow.com/questions/1912095/…
    – Vince
    Oct 25, 2017 at 21:23
  • @Vince ha, I thought it was an ArcGIS glitch, but it turns out to be generic SQL Oct 25, 2017 at 21:47
  • It was generic to many 4GL languages that I've used. SQL is one of a few that survived that generation.
    – Vince
    Oct 25, 2017 at 23:05

1 Answer 1


As with the ArcObjects question above, the answer is to include a second single quote:

&where=locality = 'O''CONNELL'

enter image description here

  • I wasted ages trying other useless approaches, so I'm adding this to Stack Exchange in case it helps someone Oct 25, 2017 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.