ORACLE apex_json的使用

declare
    return_json varchar(1000);
begin
    
    -- 初始化json输出
    apex_json.initialize_clob_output;
    -- 打开json对象
    apex_json.open_object;
    -- 写入json对象
    apex_json.write(
        p_name => 'dgrm_id'
        , p_value => :appid
    );
    apex_json.write(
        p_name => 'order_code'
        , p_value => :order_code
    );
    -- 关闭json对象
    apex_json.close_object;
    -- 把json对象赋值给字符串
    return_json := APEX_JSON.get_clob_output;
    -- DBMS_OUTPUT.put_line()
    sys.htp.print(return_json);
    
end;
posted @ 2021-02-08 17:36  hziwei  阅读(488)  评论(0编辑  收藏  举报