14.9.4.4 Querying Predefined JSON Structure

Query the duality view’s DATA column to return JSON in the required structure.

The GET_OBJECT function can simply select the DATA column of the duality view to get the JSON document for an action item in exactly the format needed.

function get_object(
    p_id in number)
return json
is
    l_ret json;
begin
    app_common.report_if_error(
        action_items_common.ensure_action_exists(p_id));    
    select data
      into l_ret
      from action_items_dv
      where json_value(data,'$."_id"') = p_id;
    return l_ret;
end get_object;