Extract values with escaped characters from JSON Document

I am using the json_value function to extract values from a json document passed to a Mariadb database. When the document contains name/value pairs with escaped values such as "Item_Name":"60
" Table" the function only extracts 60 and returns null values for the rest of the name/value pairs in the document. Here is an example

``` Set @json = '{"Item_Name":"60\" Table", "Item_ID":"1"}';

select json_value(@json,'$.Item_Name') as Item_Name , json_value(@json,'$.Item_ID') as ID ```

The results of this query is:

Item_NameID
:----------:----
60null

Not sure how to extract the value with the escaped character.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.