work with json in oracle

后端 未结 6 677
梦谈多话
梦谈多话 2020-12-02 15:06

Is there an easy way to work with JSON within oracle? I have a standard procedure that I use to call web services quite often, JSON is a format that I am familiar with in w

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 15:17

    Life is happy try this:

    CLOB or 20000000 characters JSON

    with data as
      ( select 
        xmlelement(e,regexp_replace('{"name":"'||colname||'"}', '[[:cntrl:]]', ''),',') col1
        from tblname
      )
      select
            rtrim(replace(replace(replace(xmlagg(col1).getclobval(),'&'||'quot;','"'),'',''),'',''),',')
            as very_long_json
      from data;
    

提交回复
热议问题