Amol
Amol

Reputation: 428

JSON_value function not returning exact value

I was trying extract value in SQL developer from below json but it gives me wrong output

select
json_value('{"ABC": {
    "CFF": 90,
    "coord": {
      "x1": 27.4,
      "x2": 31.6,
      "y1": 61.4,
      "y2": 62.4
    },
    "value": "\\"
  }}','$."ABC".value') COL from dual

enter image description here

Kindly suggest ..

Upvotes: 0

Views: 333

Answers (1)

Daniel
Daniel

Reputation: 11192

The backslash symbol \ is also an escape character - so \\ in a quoted string "\\" becomes a single unescaped \

If you want the value to be \\ you have to double the amount of backslashes to \\\\

Upvotes: 1

Related Questions