‘Guilty as charged’ is the verdict. I owe an apology to the audience for selling vapourware. I got stuck with Data, RecordSet, ODBC connector & co, so the servlet engine got pushed on the back burner for the ump-th time. But I’m getting ready to give it a shot and push it out the door (just don’t hold me accountable for saying this 😉
Anyway, back to PocoData, what I was trying to achieve is to be able to do something like this:
Statement stmt = (session << "SELECT * FROM aTable", now);//note no 'into()' provided
for(RecordSet::Iterator it = stmt.recordSet().begin(); it != stmt.recordSet().end(); ++it)
int i1 = AnyCast<int>((*it)["fld1"]));
float f2 = AnyCast<float>((*it)["fld2"]));
Now, all this is nice and well, but I still must know the type I'm extracting, so not much is achieved. If I could do this:
int i = (*it)["fld"].toInt();
int i = toInt((*it)["fld"]);
That would be something, right? Provided I'm not concerned with performance, of course.
On how to do the above, the jury is still out. And I'm blogging about it hoping to hear some comments and ideas (code is in SVN).