PL SQL 呼叫 concurrent
注意重點:
1. 由開發工具, ex. toad、pl sql developer 呼叫 concurrent 時, 需要定義 fnd_global.apps_initialize
2. concurrent 引用參數, 除固定宣告用的五個參數之外, 可額外接收 100 個參數, 結束時必須要用 chr (0) 來終止, 否則後續參數無法接受時, 會有錯誤訊息
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | DECLARE x_user_id NUMBER; x_appl_id NUMBER; x_resp_id NUMBER; x_conc_id NUMBER; BEGIN SELECT user_id INTO x_user_id FROM fnd_user WHERE user_name = 'sysadmin'; SELECT application_id INTO x_appl_id FROM fnd_application WHERE application_short_name = 'ONT'; SELECT responsibility_id INTO x_resp_id FROM fnd_application fa, fnd_responsibility_tl fr WHERE fa.application_short_name = 'ONT' AND fa.application_id = fr.application_id AND fr.responsibility_name = 'OM_Admin_XT'; fnd_global.apps_initialize(x_user_id, x_resp_id, x_appl_id); x_conc_id := fnd_request .submit_request(application => 'XX', program => 'XXARP0004', description => NULL, start_time => NULL, sub_request => FALSE, argument1 => 1085, argument2 => NULL, argument3 => 'Y', argument4 => 'Y', argument5 => chr_(0), argument6 => NULL, argument7 => NULL, argument8 => NULL, argument9 => NULL, argument10 => NULL); -- 成功時, output ERP 內的 request ID dbms_output.put_line(x_conc_id); END; |
資訊參考:
http://orabiz.blogspot.com/2007/07/fndrequestsubmitrequest-handy-tip.html
http://www.cnblogs.com/benio/archive/2009/09/21/1570754.html