Need help parsing PLJSON Array

Johnny98
2013-02-25
2013-05-28
  • Johnny98
    Johnny98
    2013-02-25

    Hello,
    Can someone please help me parse the values from this PLSQL Block…i'm stuck:
    declare
    my_json json := json('{}');
    beam_time varchar2(64);
    begin
    beam_time := json_ext.get_string(my_json, '');
    dbms_output.put_line('event name: ' || beam_time);
    end;
    /
    THANK YOU!

     
  • Johnny98
    Johnny98
    2013-02-25

    I figured it out using this code:

    declare
    my_json json_list := json_list('');
    eventName     varchar2(100);
    eventCode     varchar2(1000);
    eventDate     varchar2(100);
    registrantName     varchar2(100);
    begin

      for i in 1..my_json.count loop
        eventName  := json_ext.get_string(json(my_json.get(i)),'event name'); 
        eventCode  := json_ext.get_string(json(my_json.get(i)),'event code');
        eventDate  := json_ext.get_string(json(my_json.get(i)),'event start date');
        registrantName  := json_ext.get_string(json(my_json.get(i)),'registrant name');   

      end loop;
          dbms_output.put_line(eventName||', '||eventCode||', '||eventDate||', '||registrantName);
    end;
    /