设置并发请求运行的状态及请求间等待

FND_CONCURRENT.SET_COMPLETION_STATUS(服务器端函数)

FND_CONCURRENT.SET_COMPLETION_STATUS (服务器端函数)

语法:

FUNCTION fnd_concurrent.set_completion_status(status  IN VARCHAR2,
                                              message IN VARCHAR2) RETURN BOOLEAN;

说明:在并发程序内调用用来设置并发程序的状态及消息。如果设置成功则返回TURE,否则返回FALSE。

输入参数说明:

status   要设置的并发程序的状态,为NORMAL, WARNING, 或者 ERROR

message 可选参数,设置消息

-----------------------------------------

不是存储过程,不能直接调用运行。

CNC_RET boolean;

CNC_RET := fnd_concurrent.set_completion_status ('WARNING',NULL);

--请求等待

FUNCTION FND_CONCURRENT.WAIT_FOR_REQUEST



Problem Description:
====================

The following describes how to submit concurrent requests using PL/SQL and
have the parent request 'wait' until each of the child processes have
completed before it completes.



Search Words: WAIT_FOR_REQUEST phase status arguments interval



Solution Description:
=====================

When submitting concurrent requests using PL/SQL, it is often desired to have
the parent process wait until all the child processes have completed before
completing itself.  The following describes the function used to accomplish
this.


Use the FND_CONCURRENT.WAIT_FOR_REQUEST function documented in the Oracle
Applications Developer’s Guide, RELEASE 11i, Page 21-8  See the FND_CONCURRENT.WAIT_FOR_REQUEST
function description.

Summary
        FUNCTION FND_CONCURRENT.WAIT_FOR_REQUEST

  (request_id IN number default NULL,
          interval   IN number default 60,
          max_wait   IN number default 0,
          phase      OUT varchar2,
          status     OUT varchar2,
          dev_phase  OUT varchar2,
          dev_status OUT varchar2,
          message    OUT varchar2) return  boolean;



Description
Wait for the request completion, then return the request phase/status and 
completion message to the caller.  Also call sleep between database checks.


Arguments (input)


   request_id
        The request ID of the program to wait on.

   interval
        Time to wait between checks.  This is the number of seconds to sleep.  
The default is 60 seconds.

   max_wait
        The maximum time in seconds to wait for the requests completion.


Arguments (output)


   phase
        The user friendly request phase from FND_LOOKUPS.

   status
        The user friendly request status from FND_LOOKUPS.

   dev_phase
        The request phase as a constant string that can be used for program 
logic comparisons.

   dev_status
        The request status as a constant string that can be used for program 
logic comparisons.

   message
        The completion message supplied if the request has completed.

语法:

FUNCTION fnd_concurrent.wait_for_request(request_id IN NUMBER DEFAULT NULL,
                                         INTERVAL   IN NUMBER DEFAULT 60,
                                         max_wait   IN NUMBER DEFAULT 0,
                                         phase      OUT VARCHAR2,
                                         status     OUT VARCHAR2,
                                         dev_phase  OUT VARCHAR2,
                                         dev_status OUT VARCHAR2,
                                         message    OUT VARCHAR2) RETURN BOOLEAN;

说明:等待并发请求的完成,然后返回请求的阶段、状态以及完成消息。在等待的过程中每隔一段时间检查一下。

输入参数说明:

request_id:  并发请求的id

interval:  两次检查见等待的秒数,两次检查之间该程序会休息

max_wait: 等待并发请求完成所能等待的的最长时间,单位为秒。

输出参数同前一个函数,恕罗勇不重复翻译啦。

原文没有示例用法,罗勇补充个:

DECLARE
  call_status BOOLEAN;
  rphase      VARCHAR2(80);
  rstatus     VARCHAR2(80);
  dphase      VARCHAR2(30);
  dstatus     VARCHAR2(30);
  message     VARCHAR2(240);
  request_id NUMBER;
BEGIN
  request_id := 3046222;
  call_status := fnd_concurrent.wait_for_request(request_id,
                                                   10,
                                                   1000,
                                                   rphase,
                                                   rstatus,
                                                   dphase,
                                                   dstatus,
                                                   message);
  IF call_status THEN
    dbms_output.put_line(rphase || '|' || rstatus || '|' || message);
  END IF;
END;

程序会等在此处直到并发请求完成或者满了1000秒。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值