Hi, Teryl,
Thanks for your continued interest in FastBit. Since your program
provided FastBit the select clause, you might have a way of knowing
what variable names are used, right? For example, if you have
composed sstr form a set of variable names, then you know what they
are and can use them in any order you like.
Alternatively, if you get a string from an external source and don't
know much about it, you can create a select clause with the string and
iterative through the terms in the select clause with the code such as
following.
ibis::selectClause sc(sstr);
for (unsigned j = 0; j < sc.size(); ++ j) {
sel1->getColumnAsBytes(sc.termName(j), array);
}
Hope this makes sense to you. Please let us know if there is
something unexpected when you use this approach.
John
On 3/26/2010 1:43 PM, Teryl Taylor wrote:
> Hi John,
>
> Thanks a lot for your answers to my previous questions. They have been
> very helpful. I have another quick question. When I do a select
> query on the table, I use the following:
>
> ibis::whereClause wc(wstr);
> ibis::table *sel1 = tbl->select(sstr, wc.getExpr()->dup());
The call to dup() is unnecessary here and can be removed. In fact,
calling dup() creates another copy of the query expression that
requires explicit call to delete to free it. It is better to change
the above line to be
ibis::table *sel1 = tbl->select(sstr, wc.getExpr());
>
> And then I access the retrieved data by calling
>
> sel1->getColumnAsBytes(colName, array);
>
> to get the data out as arrays.
>
> I get the colName from calling:
>
> ibis::table::stringList col = sel1->columnNames();
>
> and then iterating through the list. However, the columnNames function
> returns the columns in table order, not in the order that was specified
> in the select clause.
>
> How can I get the columnNames in the order they are specified in the
> select clause?
>
> I'm trying to instantiate an
>
> ibis::selectClause sc(sstr); and then use the describe function to get
> the name. Is this the best bet?
>
> Regards,
>
> Teryl
>
>
>
>
> _______________________________________________
> FastBit-users mailing list
> [email protected]
> https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users