-
Call replaying failed in multiple RDB in KDB+ ?
I have rdb file like below this, but it didn’t work for replaying when I run
list_tables: (`derivatives_positions);<br><br></p><p>if[not “w”=first string .z.o;system “sleep 1”];<br><br></p><p>upd:{if[x in list_tables;x insert y]};<br><br></p><p>.u.x:.z.x,(count .z.x)_(“:5010″;”:5032″);<br><br></p><p>.u.end:{t:tables`.;
{0!x}each t;
t@:where `g=attr each t@\:`sym;
.Q.hdpf[`$”:”,.u.x 1;hsym `$”/home/bitwyredev/tickerplant/risk-engine/derivatives/hdb”;x;`sym];<br> </span><span style=”background-color: transparent; font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>@[;`sym;`g#] each t;<br> </span><span style=”background-color: transparent; font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>`derivatives_positions set select by sym, instrument from derivatives_positions;
`derivatives_positions insert (`$”init”;`$”0″;00:00:00.000000000;”init”;0h;0h;0h;”000″;”000″;”000″;”000″;`$”0″;0h;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;”000″;0);
.Q.gc[];};.u.rep:{(.[;();:;].)each x;
if[null first y;:()];
-11!y;
`derivatives_positions set select by sym, instrument from derivatives_positions;<br> </span><span style=”background-color: transparent; font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>.Q.gc[];<br> </span><span style=”background-color: transparent; font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>`upd set (upsert);
system “cd /home/bitwyredev/tickerplant/risk-engine/derivatives/hdb”};.u.rep .(hopen `$”:”,.u.x 0)”.u.sub[;`]each(),`derivatives_positions”;</p><p><span style=”background-color: transparent; font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”><br></span></p><p><span style=”background-color: transparent; font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”> </span></p><p><br>my suspect is <br>.u.rep .(hopen `$”:”,.u.x 0)”.u.sub[;`]each(),`derivatives_positions”;
this code failed to called function .u.rep, when i select derivatives_positions, it doesnt create keyed tablehow to fix this code
Sorry, there were no replies found.
Log in to reply.