I was replacing text in a field of attribute table, by using "Find and Replace". After saving and making new map by [Layer properties--Categories--Unique values--VAlue field--add all values--ok]

Now when i tried to replace some text values as before i am getting this msg

"An invalid SQL statement was used" {i am attaching screenshot}enter image description here

Please help, i want to replace some text like "Calcareous duricrust" with "{Calcareous Duricrust}"

What can i do?

  • 1
    Not exactly sure what's going wrong for you, but a workaround seems to be to use Select by attributes --> Select all with the incorrect attribute --> Use Field Calculator to change it. – Martin Oct 13 '15 at 10:55

In your case, I would use the field calculator (example with python syntax below)

"{" + !UNIT_NAME!.title() + "}"

.title() will capitalize the first letter of each word, and the + sign is used for concatenation. As mentioned by @Martin, you can use select by attribute first if you don't want to apply this rule to all your records.

Alternatively, you can use the .replace() function on a case by case basis (no need to select)

"{" + !UNIT_NAME!.replace("duricrust","Duricrust") + "}"
  • 1
    Good answer, although I have used find and replace in ArcMap attribute tables many times and it works just fine. – cl3 Oct 13 '15 at 14:13
  • @cl3 I've removed the first line. Thank you for your comment. – radouxju Oct 13 '15 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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