37.12 GET_CLOB_OUTPUTファンクション

INITIALIZE_CLOB_OUTPUTを使用して作成した一時CLOBを戻します。

構文

APEX_JSON.GET_CLOB_OUTPUT (
    p_free  IN BOOLEAN  DEFAULT FALSE )
    RETURN CLOB;

パラメータ

パラメータ 説明
p_free trueの場合、出力リソースを解放します。デフォルトはfalseです。

例1

この例では、CLOB出力用にAPEX_JSONを構成してJSONを生成し、DBMS_OUTPUTを使用してCLOBを出力し、最後にCLOBを解放します。

BEGIN
  apex_json.initialize_clob_output;

  apex_json.open_object;
  apex_json.write('hello', 'world');
  apex_json.close_object;

  dbms_output.put_line(apex_json.get_clob_output);

 apex_json.free_output;
END;

例2

この例では、CLOB出力用にAPEX_JSONを構成してJSONを生成し、DBMS_OUTPUTおよびGET_CLOB_OUTPUTを使用してCLOBを出力して解放します。

BEGIN
  apex_json.initialize_clob_output;

  apex_json.open_object;
  apex_json.write('hello', 'world');
  apex_json.close_object;

  dbms_output.put_line(apex_json.get_clob_output( p_free => true ) );
END;