In most examples for SOCI, the caller must know the fields and types in a query and specifies them through a soci::rowset<> of boost::tuple<> or through some other means.
Is there a way to code without knowing the types and number of columns beforehand, as in a SELECT * FROM ... query?
If so, could you post a short example?
soci::rowset<soci::row>is exactly what you need —soci::rowprovides dynamic binding.From the docs:
See:
http://soci.sourceforge.net/doc/3.2/exchange.html#dynamic
http://soci.sourceforge.net/doc/3.2/statements.html#rowset
for details.
Excerpt from the documentation: