2016-08-13 59 views
0

欣賞,如果有人幫我解決這個問題。具有OSB中的存儲過程的數據庫適配器

我想用在OSB一個DB適配器選擇從數據庫記錄,併爲我寫在Oracle中的存儲過程,它是象下面這樣: -

create or replace 
PROCEDURE TRY_POC(ERROR_STATUS IN varchar2,TYPE_ERROR IN varchar2,ERROR_TIMESTAMP IN varchar2,p_cur out sys_refcursor) IS 

BEGIN 

open p_cur for 
select * from CommonLogTable where STATUS=ERROR_STATUS 
and ERROR_TYPE=TYPE_ERROR 
and 
to_date(
(
substr(Error_Timestamp,9,2)||'-'|| 
substr(Error_Timestamp,6,2)||'-'|| 
substr(Error_Timestamp,1,4)||' '|| 
substr(Error_Timestamp,12,2)||':'|| 
substr(Error_Timestamp,15,2)||':'|| 
substr(Error_Timestamp,18,2) 
),'DD-MM-YYYY HH24:MI:SS') < to_date(to_char(current_timestamp,'DD-MM-YYYY HH24:MI:SS'),'DD-MM-YYYY HH24:MI:SS') 
AND to_date(
(
substr(Error_Timestamp,9,2)||'-'|| 
substr(Error_Timestamp,6,2)||'-'|| 
substr(error_timestamp,1,4)||' '|| 
substr(Error_Timestamp,12,2)||':'|| 
substr(Error_Timestamp,15,2)||':'|| 
substr(Error_Timestamp,18,2) 
),'DD-MM-YYYY HH24:MI:SS') >= to_date(to_char(current_timestamp-(5 * (1/24/60)),'DD-MM-YYYY HH24:MI:SS'),'DD-MM- 
YYYY HH24:MI:SS'); 
end TRY_POC; 

什麼這個存儲過程是做它正在根據狀態,Error_Type和Error_Timestamp(它將在運行時傳遞)從CommonLoTable中提取te記錄,並獲取位於

之間的記錄當前時間戳=當前時間戳-5 而我需要的錯誤時間戳格式是像2016-08-13T16:30:00。

我想在運行時傳遞所有Error_Type,Status和Error_Timestamp的值。我無法在運行時從OSB傳遞Error_Timestamp的值。

由於提前

回答

0

可以在管道使用XQuery函數執行-SQL(),並調用你的SQL語句。輸入參數可以在運行時從代理服務接受,然後將這些值映射到sql查詢條件參數。