45.51 PROCESS_DML_RESPONSEプロシージャ
このプロシージャは、DMLリクエスト・レスポンスを解析し、戻り値を値コンテキスト・オブジェクトにロードします。
このプロシージャは、常にルート・レベルでJSONを解析します。配列列を渡すことはできません。配列列の内容には、APEX_EXEC
のOPEN_ARRAYプロシージャのシグネチャ1およびCLOSE_ARRAYプロシージャを使用して値コンテキストでアクセスできます。
構文
APEX_PLUGIN_UTIL.PROCESS_DML_RESPONSE (
p_web_source_operation IN apex_plugin.t_web_source_operation,
p_web_source IN apex_plugin.t_web_source,
--
p_response IN CLOB,
p_status_code IN pls_integer,
p_error_message IN VARCHAR2,
--
p_values_context IN apex_exec.t_context );
パラメータ
パラメータ | 説明 |
---|---|
p_web_source_operation |
RESTデータ・ソース操作(プラグイン)のメタデータ |
p_web_source |
RESTデータ・ソース(プラグイン)のメタデータ |
p_response |
解析するRESTレスポンス |
p_status_code |
使用するHTTPステータス・コード |
p_error_message |
使用するエラー・メッセージ |
p_values_context |
戻り値を格納する値コンテキスト |
例
次の例では、プラグインDMLプロシージャ内でPROCESS_DML_RESPONSEを使用します。
procedure plugin_dml(
p_plugin in apex_plugin.t_plugin,
p_web_source in apex_plugin.t_web_source,
p_params in apex_plugin.t_web_source_dml_params,
p_result in out nocopy apex_plugin.t_web_source_dml_result )
IS
l_web_source_operation apex_plugin.t_web_source_operation;
l_request_body clob;
l_response clob;
l_return_values_ctx apex_exec.t_context := p_params.insert_values_context;
BEGIN
l_web_source_operation := apex_plugin_util.get_web_source_operation(
p_web_source => p_web_source,
p_db_operation => apex_plugin.c_db_operation_insert,
p_perform_init => true );
apex_plugin_util.build_request_body(
p_request_format => apex_plugin.c_format_json,
p_profile_columns => p_web_source.profile_columns,
p_values_context => p_params.insert_values_context,
p_build_when_empty => true,
p_request_body => l_request_body );
-- continue with APEX_PLUGIN_UTIL.MAKE_REST_REQUEST
apex_plugin_util.process_dml_response(
p_web_source_operation => l_web_source_operation,
p_web_source => p_web_source,
--
p_response => l_response,
--
p_status_code => apex_web_service.g_status_code,
p_error_message => apex_web_service.g_reason_phrase,
--
p_values_context => l_return_values_ctx );
END plugin_dml;
親トピック: APEX_PLUGIN_UTIL