I am trying to manipulate the upd function in a KDB tickerplant so that it can accept a table as the data argument.
When trying to insert locally, insert does not seem to like being passed the data from the table but will handle a list of lists fine when passed from the feedhandler. Why is this?
tbl1:([] sym:`symbol$(); price:`int$(); vol:`long$())
tbl2:([] sym:3?`3;price:3?10i;vol:3?100j)
insert[tbl1;(value each tbl2)]
'type
upd:{[t;x] upsert[t;x]}
upd[`tbl1;(value each tbl2)]
`tbl1
There are two issues with your example above
insert
requires the left argument to be a symbol atomq)insert[`tbl1;value flip tbl2];tbl1
sym price vol
-------------
lhk 8 49
mga 1 82
mio 7 40
upsert
is more flexible