zoukankan      html  css  js  c++  java
  • PLSQL提交请求集

    1. PROCEDURE prc_do_import_set(prm_org     IN NUMBER,   
    2.                               prm_appcode OUT NUMBER,   
    3.                               prm_appmsg  OUT VARCHAR2) IS  
    4.     custom_exception EXCEPTION;   
    5.     success        BOOLEAN;   
    6.     v_request_id   NUMBER;   
    7.     v_phase        VARCHAR2(30);   
    8.     v_status       VARCHAR2(30);   
    9.     v_dev_phase    VARCHAR2(30);   
    10.     v_dev_status   VARCHAR2(30);   
    11.     v_message      VARCHAR2(1000);   
    12.     v_request_flag BOOLEAN;   
    13.     v_start_time   VARCHAR2(30);   
    14.   BEGIN  
    15.     prm_appcode := 0;   
    16.     --初始化设置   
    17.     fnd_global.apps_initialize(user_id      => global_user_id,   
    18.                                resp_id      => global_resp_id,   
    19.                                resp_appl_id => global_resp_appl_id);   
    20.     --设置请求集   
    21.     success := fnd_submit.set_request_set('INV''PLM_ERP_IMPORT');   
    22.     IF NOT success THEN  
    23.       RAISE custom_exception;   
    24.     END IF;   
    25.     --设置单请求参数   
    26.     success := fnd_submit.submit_program('INV',   
    27.                                          'INCOIN',   
    28.                                          'STAGE10',   
    29.                                          prm_org,   
    30.                                          '1',   
    31.                                          '1',   
    32.                                          '1',   
    33.                                          '1',   
    34.                                          '1',   
    35.                                          '1',   
    36.                                          chr(0));   
    37.     IF NOT success THEN  
    38.       RAISE custom_exception;   
    39.     END IF;   
    40.     v_start_time := to_char(SYSDATE, 'DD-MON-YYYY HH24:MI:SS');   
    41.     v_request_id := fnd_submit.submit_set(v_start_time, FALSE);   
    42.     IF v_request_id = 0 THEN  
    43.       RAISE custom_exception;   
    44.     ELSE  
    45.       COMMIT;   
    46.     END IF;   
    47.     --等待   
    48.     v_request_flag := fnd_concurrent.wait_for_request(request_id => v_request_id,   
    49.                                                       INTERVAL   => 5,   
    50.                                                       max_wait   => 0,   
    51.                                                       phase      => v_phase,   
    52.                                                       status     => v_status,   
    53.                                                       dev_phase  => v_dev_phase,   
    54.                                                       dev_status => v_dev_status,   
    55.                                                       message    => v_message);   
    56.     IF v_request_flag THEN  
    57.       IF v_dev_status = 'NORMAL' THEN  
    58.         NULL;   
    59.       ELSE  
    60.         RAISE custom_exception;   
    61.       END IF;   
    62.     ELSE  
    63.       RAISE custom_exception;   
    64.     END IF;   
    65.   EXCEPTION   
    66.     WHEN custom_exception THEN  
    67.       prm_appcode := -1;   
    68.       prm_appmsg  := '错误提示:导入ERP正式表出错!' || SQLERRM;   
    69.     WHEN OTHERS THEN  
    70.       prm_appcode := -1;   
    71.       prm_appmsg  := '错误提示:导入ERP正式表出错!' || SQLERRM;   
    72.   END prc_do_import_set;  
  • 相关阅读:
    线程安全的signals
    排序
    TCMalloc : ThreadCaching Malloc
    C++箴言:争取异常安全的代码
    windows 内存泄露debug的相关函数
    分析几个驱动
    CAsyncSocket对象不能跨线程之分析 (转载)
    优化理论
    标 题: C++0x把Concept去掉了
    几个流行的http 服务器开源软件
  • 原文地址:https://www.cnblogs.com/benio/p/2373589.html
Copyright © 2011-2022 走看看