cancel
Showing results for 
Search instead for 
Did you mean: 

RE: [personal kdb+] Iterate saving down a table

david_demner
New Contributor
X-Originating-IP: 174.7.128.233User-Agent: Workspace Webmail 5.14.0Message-Id: <20150511075056.85f80dae80d1d2f2e266ec6278e6cbe8.f9b38e6824.wbe@email07.europe.secureserver.net>From: "David Demner \(AquaQ\)" To: personal-kdbplus@googlegroups.comSubject: RE: [personal kdb+] Iterate saving down a tableDate: Mon, 11 May 2015 07:50:56 -0700Mime-Version: 1.0
You would have to pass in the table name as the parameter, like so:

savedata:{[tab;dt] .Q.dpft[`:/home/dir/hdb;dt;`sym;tab];}
savedata[`t;.z.d-1]

and then something like
savedata[;.z.d-1]each tables[]
(assuming all tables should be parted by sym)

-------- Original Message --------
Subject: [personal kdb+] Iterate saving down a table
From: John Smith <js610308@gmail.com>
Date: Mon, May 11, 2015 7:37 am
To: personal-kdbplus@googlegroups.com


Hi,

I'm trying to save down a date partitioned table to disk. Using the .Q.dpft[':/path/to/location;.z.d;'sym;'tablename].

This woks fine. I want to do this multiple times at end of day to the various tables that exist., and so I'd like to enclose this in a function, and pass the table name(s)in iteratively, saving down each one, one at a time. But how do I do this given I won't be writing the explicit name of the table for the last parameter, rather the local parameters name, so I think this doesn't work.
Eg
savedata:{[tab;dt] .Q.dpft['/home/dir/hdb;dt;'sym;'tab];}

savedata[t;.z.d-1]. //t is table saved in memory.

Regard, John

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
0 REPLIES 0