how to save result from a timer function?

hi, gurus,

I have a timer function that calls a remote function ‘diff’ like this:

.z.ts:{show h “diff ab`c”}

\t 1000

the result looks like

name age

-----------------

Bob 20

George 30

How could I save this result into a local table so that I can look into later?

thank you in advance!

Razr

to assign the result to a global variable you can use

.z.ts:{show result::h “diff ab`c”}
or

.z.ts:{show get result set h "diff abc"}

to assign to a function local variable, just use a single :

.z.ts:{show result:h “diff ab`c”}

You can also define a local schema and simply use upsert. This way you can insert a timestamp and track the differences…something along the lines of:

tab:(name:;age:int$();time:`time$())

.z.ts:{res upsert h"diff abc";update time:.z.t from `res where null time}

Hope it helps.

Cheers,

Sean

This works for me. did not know ‘::’ has the magic. 
Thanks a lot, Charles!

I was actually thinking about doing this in later stage :) 
Thank you!