Hi all,
I am trying to update a linked column but am receiving an error.
I have a function similar to
updateCol:{[d]
:c:/hdb/2015.05.01/trade/ set (update mas:mas!mas.sym?sym from select from trade where date=d)};
I added the original linked col by using
addcol[
:/hdb;trade;
mas;{mas!mas.sym?get(
)sv x, sym}];
but its out of date now and want to update it.
When I run the updateCol function I get an access is denied error. I think the problem lies in the “select from trade where date=d” part because when I pull this out of the function the table is too large. Is there another better way to do this?
it may be because select from trade where date=d keeps a reference to the file on disk, which is then locked when you try to set<o:p></o:p>
<o:p> </o:p>
You can read the column into memory and then writ it down:<o:p></o:p>
<o:p> </o:p>
updateCol:{[d] f set mas!mas.sym?get f:
:c:/hdb/2015.05.01/trade/sym)};<o:p></o:p>
<o:p> </o:p>
which would also be way more efficient because you are only reading/writing the one column<o:p></o:p>
<o:p> </o:p>
From: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] On Behalf Of Roni Hoffman
Sent: Friday, June 5, 2015 5:02 AM
To: personal-kdbplus@googlegroups.com
Subject: [personal kdb+] Updating a linked column<o:p></o:p>
<o:p> </o:p>
Hi all,<o:p></o:p>
<o:p> </o:p>
I am trying to update a linked column but am receiving an error.<o:p></o:p>
<o:p> </o:p>
I have a function similar to<o:p></o:p>
<o:p> </o:p>
updateCol:{[d]:c:/hdb/2015.05.01/trade/ set (update mas:
mas!mas.sym?sym from select from trade where date=d)};<o:p></o:p>
I added the original linked col by using <o:p></o:p>
<o:p> </o:p>
addcol[:/hdb;
trade;mas;{
mas!mas.sym?get()sv x,
sym}];<o:p></o:p>
but its out of date now and want to update it.<o:p></o:p>
<o:p> </o:p>
When I run the updateCol function I get an access is denied error. I think the problem lies in the “select from trade where date=d” part because when I pull this out of the function the table is too large. Is there another better way to do this?<o:p></o:p>
–
Submitted via Google Groups
I see, thanks very much David