[odb-users] Native sqlite3 recursive SQL query

MM finjulhich at gmail.com
Wed Jun 20 06:57:58 EDT 2018


On 18 June 2018 at 13:38, Boris Kolpackov <boris at codesynthesis.com> wrote:

> MM <finjulhich at gmail.com> writes:
>
> > std::ostringstream oss;
> > oss << "SELECT mycolumn FROM sometable WHERE id IN (.."
> >        << myparameter << "...)";
> > auto nbr_rows = odb::database::execute( oss.str() );
> >
> > Is there a way to get the resulting mycolumn as a
> std::vector<std::string> ?
>
> See native views.
>

The manual says
"To indicate that a native view has a runtime query, we can either specify
the empty db query pragma or omit the pragma altogether."

I have tried to omit the pragma altogether, however that failed to compile.
(I've noticed the error says class_kind was neither object nor view but
other).

I've then added the pragma and that compiled fine and worked fine too.

Thank you very much,

MM


More information about the odb-users mailing list