[Cppcms-users] Cppdb: How to fetch a column of unknown type at compile time?
Brought to you by:
artyom-beilis
|
From: Daniel V. <chi...@gm...> - 2011-01-03 20:48:34
|
How to fetch a column of unknown type at compile time with cppdb?
For example in soci we can do code like this:
row r;
sql << "select arbitrary_column from arbitrary_table where id =
1", into(r);
const column_properties & props = r.get_properties(0);
switch(props.get_data_type())
{
case dt_string:
cout << r.get<std::string>(i);
break;
case dt_integer:
cout << r.get<int>(i);
break;
//others cases...
}
What is the recommended way to accomplish this with cppdb? ( If one
exists).
Thanks.
|