some problem retrieving data in c++

Oops! why this intefaces(C++) are difficult ?

I’m tryng to get collection data from table
but don’t work , can’t solve it

how can i get these datas

time sym price size etc
09:30:00.000 AIG 10 200 1
09:30:01.000 IBM 55 500 1
09:30:02.000 IBM 75 100 1
09:30:03.000 AIG 75 400 1
09:30:00.000 AIG 10 200 1
09:30:01.000 IBM 55 500 1
09:30:02.000 IBM 75 100 1
09:30:03.000 AIG 75 400 1



K x,y,x1,kRows,kCols;
x1 = k(m_nHandle,“{[s] select from KOptTick where
sym=s}”,ks(strCode.GetBuffer(0)),0);
x = ktd(x1);

int nCols, nRows;
y = x->k;

kRows = kK(y)[0];
nRows = kRows->n;

kCols= kK(y)[1];
nCols = kCols->n;

int nPrice, nSize;
for(int i=0; i {
nPrice = kI(kK(kRows)[i])[2];
}

how can i retrieve price data for each rows ???

A bit harder than it looks, isn’t it? ;-)Here’s some pointers:1. You can’t access table by rows - only by columns.2. ktd() <- is unnecessary in your case, but would be if there was"by" in your select.3. [0] and [1] of this dictionary (“flipped back” table) are not rowsand columns, but rather column names and columns themselves.4. Because of #1 you’ll be retrieving values of the row one by onefrom corresponding columns @ index corresponding to row, through theaccessors corresponding to the type of this column.5. While you at it, remember to lookout for ±W and 0N values(different for different types)Good luck!On Feb 16, 9:55?am, biyawara <biyaw…> wrote:> Oops! why this intefaces(C++) are difficult ?>> I’m tryng to get collection data from table> but don’t work , can’t solve it>> how can i get these datas>>

> time ? ? ? ? ? ? ? ? sym ?price size ?etc> 09:30:00.000 ? ?AIG ? ? 10 ? ? ?200 ? ? 1> 09:30:01.000 ? ?IBM ? ? 55 ? ? ?500 ? ? 1> 09:30:02.000 ? ?IBM ? ? 75 ? ? ?100 ? ? 1> 09:30:03.000 ? ?AIG ? ? 75 ? ? ?400 ? ? 1> 09:30:00.000 ? ?AIG ? ? 10 ? ? ?200 ? ? 1> 09:30:01.000 ? ?IBM ? ? 55 ? ? ?500 ? ? 1> 09:30:02.000 ? ?IBM ? ? 75 ? ? ?100 ? ? 1> 09:30:03.000 ? ?AIG ? ? 75 ? ? ?400 ? ? 1>> >> ? ? ? ? K x,y,x1,kRows,kCols;> ? ? ? ? x1 = k(m_nHandle,“{[s] select from KOptTick where> sym=s}”,ks(strCode.GetBuffer(0)),0);> ? ? ? ? x = ktd(x1);>> ? ? ? ? int nCols, nRows;> ? ? ? ? y = x->k;>> ? ? ? ? kRows = kK(y)[0];> ? ? ? ? nRows = kRows->n;>> ? ? ? ? kCols= kK(y)[1];> ? ? ? ? nCols = kCols->n;>> ? ? ? ? int ? ? nPrice, nSize;> ? ? ? ? for(int i=0; i ? ? ? ? {> ? ? ? ? ? ? ? ? nPrice = kI(kK(kRows)[i])[2];> ? ? ? ? }>> ?how can i retrieve price data for each rows ???

thanks, i solve itOn 2??16??, ???4??53??, _Oz_ <zakharovo…> wrote:> A bit harder than it looks, isn’t it? ;-)>> Here’s some pointers:>> 1. You can’t access table by rows - only by columns.> 2. ktd() <- is unnecessary in your case, but would be if there was> “by” in your select.> 3. [0] and [1] of this dictionary (“flipped back” table) are not rows> and columns, but rather column names and columns themselves.> 4. Because of #1 you’ll be retrieving values of the row one by one> from corresponding columns @ index corresponding to row, through the> accessors corresponding to the type of this column.> 5. While you at it, remember to lookout for ±W and 0N values> (different for different types)>> Good luck!>> On Feb 16, 9:55 am, biyawara <biyaw…> wrote:>>>>>>>> > Oops! why this intefaces(C++) are difficult ?>> > I’m tryng to get collection data from table> > but don’t work , can’t solve it>> > how can i get these datas>> >

> > time sym price size etc> > 09:30:00.000 AIG 10 200 1> > 09:30:01.000 IBM 55 500 1> > 09:30:02.000 IBM 75 100 1> > 09:30:03.000 AIG 75 400 1> > 09:30:00.000 AIG 10 200 1> > 09:30:01.000 IBM 55 500 1> > 09:30:02.000 IBM 75 100 1> > 09:30:03.000 AIG 75 400 1>> > >> > K x,y,x1,kRows,kCols;> > x1 = k(m_nHandle,“{[s] select from KOptTick where> > sym=s}”,ks(strCode.GetBuffer(0)),0);> > x = ktd(x1);>> > int nCols, nRows;> > y = x->k;>> > kRows = kK(y)[0];> > nRows = kRows->n;>> > kCols= kK(y)[1];> > nCols = kCols->n;>> > int nPrice, nSize;> > for(int i=0; i > {> > nPrice = kI(kK(kRows)[i])[2];> > }>> > how can i retrieve price data for each rows ???

Biyawara,Could you please print changes to above code on how you solved thisplease, I will try to learn this from that code as I am new and havingtough time understanding, how to read table data into C++ variables.Thank you.On Feb 16, 1:50 pm, biyawara <biyaw…> wrote:> thanks, i solve it>> On 2??16??, ???4??53??, Oz <zakharovo…> wrote:>> > A bit harder than it looks, isn’t it? ;-)>> > Here’s some pointers:>> > 1. You can’t access table by rows - only by columns.> > 2. ktd() <- is unnecessary in your case, but would be if there was> > “by” in your select.> > 3. [0] and [1] of this dictionary (“flipped back” table) are not rows> > and columns, but rather column names and columns themselves.> > 4. Because of #1 you’ll be retrieving values of the row one by one> > from corresponding columns @ index corresponding to row, through the> > accessors corresponding to the type of this column.> > 5. While you at it, remember to lookout for ±W and 0N values> > (different for different types)>> > Good luck!>> > On Feb 16, 9:55 am, biyawara <biyaw…> wrote:>> > > Oops! why this intefaces(C++) are difficult ?>> > > I’m tryng to get collection data from table> > > but don’t work , can’t solve it>> > > how can i get these datas>> > >

> > > time sym price size etc> > > 09:30:00.000 AIG 10 200 1> > > 09:30:01.000 IBM 55 500 1> > > 09:30:02.000 IBM 75 100 1> > > 09:30:03.000 AIG 75 400 1> > > 09:30:00.000 AIG 10 200 1> > > 09:30:01.000 IBM 55 500 1> > > 09:30:02.000 IBM 75 100 1> > > 09:30:03.000 AIG 75 400 1>> > > >> > > K x,y,x1,kRows,kCols;> > > x1 = k(m_nHandle,“{[s] select from KOptTick where> > > sym=s}”,ks(strCode.GetBuffer(0)),0);> > > x = ktd(x1);>> > > int nCols, nRows;> > > y = x->k;>> > > kRows = kK(y)[0];> > > nRows = kRows->n;>> > > kCols= kK(y)[1];> > > nCols = kCols->n;>> > > int nPrice, nSize;> > > for(int i=0; i > > {> > > nPrice = kI(kK(kRows)[i])[2];> > > }>> > > how can i retrieve price data for each rows ???