java - How to do an Upsert operation using WSO2 CEP and Siddhi Query Language -


i have userstream having username,ipaddress,timestamp

i want store details in userdetailstable (in memory table) , need upsert. how able update row if username , ipaddress same , insert otherwise new row.

for example:

ist userstream "rockey","192.15.12.11","10-10-2015 10.32" 2nd userstream "jose","192.15.12.21","10-10-2015 10.33" 3rd userstream "rockey","192.15.12.11","10-10-2015 10.34" 

result of userdetailstable below

"jose","192.15.12.21","10-10-2015 10.33"   (new row) "rockey","192.15.12.11","10-10-2015 10.34" (update existing row) 

you can use following method.

from userstream select username, ipaddress ,timestamp update userdetailstable on userdetailstable.username == username 

please not stream attributes , event tables attributes needs same. hope helps.

thanks.


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -