关闭

PLSQL提交请求集

47人阅读 评论(0) 收藏 举报
  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;
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:89030次
    • 积分:1536
    • 等级:
    • 排名:千里之外
    • 原创:9篇
    • 转载:390篇
    • 译文:0篇
    • 评论:2条
    最新评论