JSON_value function not returning exact value

230 Views Asked by At

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 ..

1

There are 1 best solutions below

3
Daniel On

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 \\\\