Re: How to convert a JSON string containing map data to a TABLE.
Syntax of JSON_TABLE function is:
JSON_TABLE(json_string, '$.<path>' COLUMNS (
column_name_1 <type> PATH '$.<path>',
column_name_2 <type> PATH '$.<path>')
) result;
To what do I set the paths? MySQL seems to object to numeric paths, e.g. $.1, which I can't use as the number will change.
In SQL Server, there is a lovely OPENJSON function which gives me exactly what I need, viz.
SELECT *
FROM OPENJSON(@json_string);
which produces a table of: key, value and type, over which I can retrieve my values.
What is the equivalent mySQL function?
Subject
Written By
Posted
Re: How to convert a JSON string containing map data to a TABLE.
May 15, 2022 04:04PM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.