我想使用附加條件來更新事件表(RDBMS),即其中的一列不爲空。表名是MSISDNProfileDB,它在oracle數據庫中。使用wso2 CEP處理空值
from incomingStream#window.length(1)
select correlation_MSISDN as MSISDN,
INTERACTION_DT as INTERACTION_DT
update MSISDNProfileDB
on MSISDNProfileDB.MSISDN == MSISDN
and not(MSISDNProfileDB.column1 is null);
它驗證代碼,但不更新INTERACTION_DT。出於測試目的,我將其更改爲檢查列是否爲空,並手動從column1中刪除數據。
from incomingStream#window.length(1)
select correlation_MSISDN as MSISDN,
INTERACTION_DT as INTERACTION_DT
update MSISDNProfileDB
on MSISDNProfileDB.MSISDN == MSISDN
and MSISDNProfileDB.column1 is null;
...它仍然無法正常工作。但是,當我將列值更改爲1並執行此操作時:
from incomingStream#window.length(1)
select correlation_MSISDN as MSISDN,
INTERACTION_DT as INTERACTION_DT
update MSISDNProfileDB
on MSISDNProfileDB.MSISDN == MSISDN
and MSISDNProfileDB.column1 == '1';
它的工作原理!所以,結論是cep與oracle db的空值有問題。有誰知道如何處理空值?
親切的問候, 斯特凡
嗨,你得到類似'org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException任何異常:錯誤同時更新數據庫事件,您的SQL語法錯誤; ... ',當你發送一個事件? – Grainier
嗨Granier,當我嘗試使用此行更新...和MSISDNProfileDB.column1爲空...在碳日誌中有錯誤:「由...引起:java.sql.SQLSyntaxErrorException:ORA-00936:缺少表達式」 – StStojanovic