Hi, I have looked the pub/sub mechanisim in u.q. I want to know if you upsert 2 rows in a table. How do you put *only* those 2 rows on disk ? Because saving the table using 0: or 1: or the save function will overwrite everything on disk and start from scratch ?
/ The functional dot apply takes 4 parameters. The on-disk table is overwritten if you put colon as the third param. The on-disk table is appended if you put comma as the third param.
q)newQuote:(time:(“p”$2016.06.01)+til 3; sym:A
B`C; price:0.1*til 3);
q)select from newQuote
time sym price
---------------------------------------
2016.06.01D00:00:00.000000000 A 0
2016.06.01D00:00:00.000000001 B 0.1
2016.06.01D00:00:00.000000002 C 0.2
q).[:/tmp/hdb/quote/; (); :; .Q.en[
:/tmp/hdb/; newQuote]];
q)system “l /tmp/hdb”;
q)select from quote
time sym price
---------------------------------------
2016.06.01D00:00:00.000000000 A 0
2016.06.01D00:00:00.000000001 B 0.1
2016.06.01D00:00:00.000000002 C 0.2
q).[:/tmp/hdb/quote/; (); ,; .Q.en[
:/tmp/hdb/; newQuote]];
q)system “l /tmp/hdb”;
q)select from quote
time sym price
---------------------------------------
2016.06.01D00:00:00.000000000 A 0
2016.06.01D00:00:00.000000001 B 0.1
2016.06.01D00:00:00.000000002 C 0.2
2016.06.01D00:00:00.000000000 A 0
2016.06.01D00:00:00.000000001 B 0.1
2016.06.01D00:00:00.000000002 C 0.2