Reputation: 139
I have a table t which is being updated in KDB in realtime. I want a query which does the subscription to the table?
Thanks.
Upvotes: 0
Views: 737
Reputation: 1692
Is it the classic tick.q setup?
If so, the following will work where h is the handle to the tickerplant, t is the table name and s is the subset of symbols that you wish to subscribe to:
/ subscribe and initialize
$[`~t;(upd .)each;(upd .)]h(".u.sub";t;s);
The above is from c.q: https://github.com/KxSystems/kdb/blob/master/tick/c.q
If both pub/sub services need to be set up you can follow tick.q as an example of how it can be done: https://code.kx.com/q/tutorials/startingq/tick/
Upvotes: 3