如何使用apex_json解析下面的JSON。parse APEX_JSON.get_varchar2(p_path => ' meta. columns');它给我的数字或值错误。{"data": [["2021-01-01", 22, 22, 204, 0.09090909090909091, 22.545454545454547, 1.0, 6], ["2021-01-02", 25, 25, 240, 0.4, 21.16, 1.0, 17], ["2021-01-03", 22, 22, 195, 0.2727272727272727, 21.59090909090909, 1.0, 9], ["2021-01-04", 25, 25, 175, 0.16, 17.56, 1.0, 7], ["2021-01-05", 27, 27, 181, 0.18518518518518517, 16.925925925925927, 1.0, 6], ["2021-01-06", 21, 21, 137, 0.23809523809523808, 18.333333333333332, 1.0, 7], ["2021-01-07", 18, 18, 149, 0.2222222222222222, 19.0, 1.0, 11], ["2021-01-08", 27, 27, 206, 0.2222222222222222, 20.703703703703702, 1.0, 11], ["2021-01-09", 17, 17, 129, 0.23529411764705882, 17.647058823529413, 1.0, 5], ["2021-01-10", 21, 21, 173, 0.2857142857142857, 18.714285714285715, 1.0, 8]], "meta": {"columns": ["timestamp__to_date", "visitors", "sessions", "page_views", "goal_conversion_rate", "events_per_session", "returning_visitors_rate", "goal_conversions"], "count": 89}}
1条答案
按热度按时间xu3bshqb1#
APEX_JSON.GET_VARCHAR2
返回varchar2 * 成员值 *。你发布的json有一个数组对象,该数组对象的 * meta * 路径有多个成员值。在这种情况下,循环遍历数组,并对每个数组成员值使用APEX_JSON.GET_VARCHAR2
。