2

I have a problem with Oracle ORDS escaping my GeoJSON with "

{
"id": 1,
"city": "New York",
"state_abrv": "NY",
"location": "{\"type\":\"Point\",\"coordinates\":[-73.943849, 40.6698]}"
}

In Oracle DB it is stated correctly:

{"type":"Point","coordinates":[-73.943849, 40.6698]}

Need help to figure out why the " are added and how to prevent this from happening

1 Answer 1

3

add this column alias to your restful service handler query for the JSON column

SELECT id,
       jsons "{}jsons" --this one
  FROM table_with_json

Then when ords sees the data for the column, it won't format it as JSON because it already IS json

You can use whatever you want, in your case it should probably be "{}location"

enter image description here

4
  • 1
    Thanks a million Jeff!! Works like charm now :D Truly inspiring to see you being active over all these places attempting to help people out! An example for me as a product owner/manager.
    – Sietze
    Commented Mar 26, 2020 at 14:53
  • No problem @Sietze - we have so many customers/users here, and talking to and working with customers is a huge component of being a good product manager. Welcome to SO! Commented Mar 26, 2020 at 15:38
  • 1
    @thatjeffsmith Is this feature in the documentation? I can't seem to find any mention of it. Commented Apr 15, 2020 at 14:54
  • @OlafurTryggvason not yet - and that needs fixed Commented Apr 15, 2020 at 14:55

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.