Lorenzo> Result res = query.store();
Lorenzo> const int iSize = res.size();
Lorenzo> for (int i = 0;i < iSize;i++)
Lorenzo> {
Lorenzo> cout << res[i]["mycolumnname"];
Lorenzo> // or do something else...
Lorenzo> }
That works too (and is a little more readable), and has an execution
speed comparable to the method Andrius suggested. I wonder if there
is room for improvement in the Row code, given that it runs so much
more slowly. I used the Row approach because it is the one in the
example program in the mysql++ manual.
if you are still searching where to improve speed, don't use /* ... */
operator [] (const char *) /* ... */ method.
You should use
cout << (*ib)[0] << (*ib)[1] << (*ib)[2] /* ... */;
instead of
cout << (*ib)["mycolumnname0"] << (*ib)["mycolumnname1"] <<
(*ib)["mycolumnname2"] /* ... */;