2012-02-26 105 views
1

我希望通過將整個數組作爲輸入參數或從數據庫中讀取會話狀態,從數據庫存儲過程中訪問Apex_application.g_fXX值。這可能嗎?我試圖做到這一點的原因是我想將所有繁重的處理移動到數據庫。從存儲過程訪問Apex_application.g_fXX值

TIA,Tamas

回答

1

當然,爲什麼它不工作?

CREATE OR REPLACE PACKAGE "APXPA_TEST" IS 
    PROCEDURE process_something; 
    PROCEDURE process_something2(i_values IN apex_application_global.vc_arr2); 
END "APXPA_TEST"; 
/
CREATE OR REPLACE PACKAGE BODY "APXPA_TEST" IS 
    PROCEDURE process_something 
    IS 
    BEGIN 
     FOR i in 1..apex_application.g_F02.COUNT 
     LOOP 
     apex_debug_message.log_message('processing '||apex_application.g_f02(i)||'...'); 
     END LOOP; 
    END; 

    PROCEDURE process_something2(i_values IN apex_application_global.vc_arr2) 
    IS 
    BEGIN 
     FOR i IN 1..i_values.COUNT 
     LOOP 
     apex_debug_message.log_message('processing '||i_values(i)||'...');  
     END LOOP; 
    END; 
end "APXPA_TEST"; 
/

我用基於EMP的表格形式製作了一個頁面。我在MRU之前創建了一個進程點爲On Submit - After Computations and Validations的頁面進程。

apxpa_test.process_something; 
apxpa_test.process_something2(apex_application.g_f02); 

G_F02持有ENAME

現在運行的頁面,並啓用調試。然後,只需提交表單(不需要編輯任何內容),然後查看調試。選擇最後一個條目。滾動到頁面處理的位置:您將在那裏看到輸出。 (我只使用分隔10)

Processes - point: AFTER_SUBMIT 
...Process "some process" - Type: PLSQL 
...Execute Statement: begin apxpa_test.process_something; apxpa_test.process_something2(apex_application.g_f02); end; 
processing KING... 
processing CLARK... 
processing MILLER... 
processing KING... 
processing CLARK... 
processing MILLER... 
...Process "ApplyMRU" - Type: MULTI_ROW_UPDATE 
...Process "ApplyMRD" - Type: MULTI_ROW_DELETE