36.28 PARSE Procedure Signature 2

This procedure parses a JSON-formatted varchar2 or clob and puts the members into the package global g_values. This simplified API works similar to the parse() procedure for signature 1, but saves the developer from declaring a local variable for parsed JSON data and passing it to each JSON API call.

Syntax

APEX_JSON.PARSE (
    p_source    IN VARCHAR2,
    p_strict    IN BOOLEAN  DEFAULT TRUE );

APEX_JSON.PARSE (
    p_source    IN CLOB,
    p_strict    IN BOOLEAN  DEFAULT TRUE );

Parameters

Table 36-35 PARSE Parameters

Parameter Description
p_source The JSON source (VARCHAR2 or CLOB).
p_strict If TRUE (default), enforce strict JSON rules.

Example

This example parses JSON and prints member values.

apex_json.parse('{ "type": "circle", "coord": [10, 20] }');
sys.htp.p('Point at '||
    apex_json.get_number(p_path=>'coord[1]')||
    ','||
    apex_json.get_number(p_path=>'coord[2]'));