-
Assigning upd inside a function and replay TP log
I have created sample tp logs and I want to replay it. However, if the upd function is defined inside a function, the error occurred when I replay. Is it related to scope or namespace? Thanks.
I’ve simplified my code and put it below.
Create TP log
tableName:`students; students:([] id:1 2; name:`Foo`Bar); `:tpLog set (); h:hopen`:tpLog; {h enlist(`upd;tableName;value x)} each select from tableName; hclose h
\\
(The code formatting mess up and I can’t fix it. Please ignore those html tags.)
//Load TP log (with error) students:([]id:`long$(); name:`symbol$()); f:{[x] upd:insert; -11!`:tpLog }["foo"]; <p><br></p></pre><pre>//Load TP log (without error) students:([]id:`long$(); name:`symbol$()); upd:insert; -11!`:tpLog
The error
'upd [3] /Users/gazi/src/kdb-test/test.q:4: upd:insert; -11!`:tpLog ^ }
-
This discussion was modified 1 week, 5 days ago by
gazi.
-
This discussion was modified 1 week, 5 days ago by
gazi. Reason: formatting
-
This discussion was modified 1 week, 5 days ago by
gazi. Reason: formatting again
-
This discussion was modified 1 week, 5 days ago by
gazi. Reason: formatting again again
-
This discussion was modified 1 week, 5 days ago by
gazi.
-
This discussion was modified 1 week, 5 days ago by
Log in to reply.