Getting column names from a K object?

Hi, 

Did a query and have it all returned in a K object. Now am trying to figure out if I can somehow get the original table or the column names from this K object. 

I did 

// assume inputK is where I need to get data from 

K flip = ktd(inputK);

K c1 = kK(flip->k)[0]; 

int numcols = c1->n; 

But how do i get the name of the columns or the table this came from? 

N

for column names, see
http://code.kx.com/wsvn/code/contrib/wiki/csv.c

you can’t get the table name as this is a value only.

c1 is a list of symbols so just use symbol list accessor function kS:

char* firstColName = kS(c1)[0];

char* secondColName = kS(c1)[1];

etc.

HTH,

Pawel

2013/11/22 kdb newb <macdev21@gmail.com>

Hi, 

Did a query and have it all returned in a K object. Now am trying to figure out if I can somehow get the original table or the column names from this K object. 

I did 

// assume inputK is where I need to get data from 

K flip = ktd(inputK);

K c1 = kK(flip->k)[0]; 

int numcols = c1->n; 

But how do i get the name of the columns or the table this came from? 


N

--

Submitted via Google Groups

Hey, you can look about this documentation:

http://code.kx.com/wsvn/code/contrib/rpairceir/Interfacing%20KDB%20to%20C/AquaQ%20Analytics%20Transferring%20Data%20between%20kdb%2B%20and%20C%20V1.0.pdf

Page 18 might help you with this.

Nice document. <o:p></o:p>

<o:p> </o:p>

But what I am missing here is an introduction to the k.h header file and especially to the K struct.<o:p></o:p>

<o:p> </o:p>

Kim<o:p></o:p>

<o:p> </o:p>

Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von WooiKent Lee
Gesendet: Freitag, 22. November 2013 17:05
An: personal-kdbplus@googlegroups.com
Betreff: [personal kdb+] Re: Getting column names from a K object?<o:p></o:p>

<o:p> </o:p>

Hey, you can look about this documentation:

http://code.kx.com/wsvn/code/contrib/rpairceir/Interfacing%20KDB%20to%20C/AquaQ%20Analytics%20Transferring%20Data%20between%20kdb%2B%20and%20C%20V1.0.pdf

Page 18 might help you with this.